From d93b97fbcfdd5cd255a456ee4d8d6d8020103862 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sat, 18 Mar 2017 12:40:58 +0100 Subject: [PATCH] Set to nullptr after delete --- src/httpserver.cpp | 1 + src/test/dbwrapper_tests.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/httpserver.cpp b/src/httpserver.cpp index e1763c6ad..5f240d3c4 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -482,6 +482,7 @@ void StopHTTPServer() 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"); diff --git a/src/test/dbwrapper_tests.cpp b/src/test/dbwrapper_tests.cpp index 22c90bd95..9d55beb8e 100644 --- a/src/test/dbwrapper_tests.cpp +++ b/src/test/dbwrapper_tests.cpp @@ -141,6 +141,7 @@ BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate) // 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 @@ BOOST_AUTO_TEST_CASE(existing_data_reindex) // 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);