Browse Source

Merge #10027: Set to nullptr after delete

d93b97f Set to nullptr after delete (practicalswift)

Tree-SHA512: 7201cef4541557ffe31f52ce7527c4b08a2ff5aa1eae5268bdfee5b4843881f8fd115257bef6d1b4dfb71166951950a912ce87aef160ca89c2ca2ae264cfab1b
0.15
Wladimir J. van der Laan 8 years ago
parent
commit
5c1a958124
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 1
      src/httpserver.cpp
  2. 2
      src/test/dbwrapper_tests.cpp

1
src/httpserver.cpp

@ -475,6 +475,7 @@ void StopHTTPServer() @@ -475,6 +475,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");

2
src/test/dbwrapper_tests.cpp

@ -141,6 +141,7 @@ BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate) @@ -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) @@ -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);

Loading…
Cancel
Save