Skip to content

Commit

Permalink
remove superflous nullptr check before deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbytemaster committed Feb 23, 2020
1 parent 57bcf2e commit 222d542
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ void Shutdown() {
boost::filesystem::remove(GetPidFile());
UnregisterAllWallets();

if (pWalletMain)
delete pWalletMain;
delete pWalletMain;

// Uninitialize elliptic curve code
globalVerifyHandle.reset();
Expand Down
13 changes: 5 additions & 8 deletions src/tests/scriptdb_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ void init() {

void closedb() {

if (pTestView != NULL) {
delete pTestView;
pTestView = NULL;
}
if (pTestDB != NULL) {
delete pTestDB;
pTestDB = NULL;
}
delete pTestView;
pTestView = NULL;
delete pTestDB;
pTestDB = NULL;

const boost::filesystem::path p=GetDataDir() / "blocks" / "testdb";
boost::filesystem::remove_all(p);

Expand Down

0 comments on commit 222d542

Please sign in to comment.