changeset 26998:22f9df134f62

Merge #10027: Set to nullptr after delete d93b97f Set to nullptr after delete (practicalswift) Tree-SHA512: 7201cef4541557ffe31f52ce7527c4b08a2ff5aa1eae5268bdfee5b4843881f8fd115257bef6d1b4dfb71166951950a912ce87aef160ca89c2ca2ae264cfab1b
author Wladimir J. van der Laan <laanwj@gmail.com>
date Mon, 20 Mar 2017 08:39:13 +0100
parents eb1312cdf776 cb6781fe8f24
children 3dedd282b9c0 2e2f9e3e0c4a 0454849d67eb
files src/httpserver.cpp
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/httpserver.cpp	Sun Mar 19 11:26:31 2017 +0100
+++ b/src/httpserver.cpp	Mon Mar 20 08:39:13 2017 +0100
@@ -475,6 +475,7 @@
         LogPrint("http", "Waiting for HTTP worker threads to exit\n");
         workQueue->WaitExit();
         delete workQueue;
+        workQueue = nullptr;
     }
     if (eventBase) {
         LogPrint("http", "Waiting for HTTP event thread to exit\n");
--- a/src/test/dbwrapper_tests.cpp	Sun Mar 19 11:26:31 2017 +0100
+++ b/src/test/dbwrapper_tests.cpp	Mon Mar 20 08:39:13 2017 +0100
@@ -141,6 +141,7 @@
 
     // Call the destructor to free leveldb LOCK
     delete dbw;
+    dbw = nullptr;
 
     // Now, set up another wrapper that wants to obfuscate the same directory
     CDBWrapper odbw(ph, (1 << 10), false, false, true);
@@ -182,6 +183,7 @@
 
     // Call the destructor to free leveldb LOCK
     delete dbw;
+    dbw = nullptr;
 
     // Simulate a -reindex by wiping the existing data store
     CDBWrapper odbw(ph, (1 << 10), false, true, true);