Skip to content

Commit

Permalink
Merge bitcoin#10027: Set to nullptr after delete
Browse files Browse the repository at this point in the history
d93b97f Set to nullptr after delete (practicalswift)

Tree-SHA512: 7201cef4541557ffe31f52ce7527c4b08a2ff5aa1eae5268bdfee5b4843881f8fd115257bef6d1b4dfb71166951950a912ce87aef160ca89c2ca2ae264cfab1b
  • Loading branch information
laanwj authored and PastaPastaPasta committed Mar 13, 2019
1 parent 514cccb commit 25dead5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/httpserver.cpp
Expand Up @@ -481,6 +481,7 @@ void StopHTTPServer()
workQueue->WaitExit();
#endif
delete workQueue;
workQueue = nullptr;
}
if (eventBase) {
LogPrint("http", "Waiting for HTTP event thread to exit\n");
Expand Down
2 changes: 2 additions & 0 deletions src/test/dbwrapper_tests.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 25dead5

Please sign in to comment.