minor variable init changes in init.cpp

- explicit init of pcoinsdbview and pwalletMain (even if not needed, as
  globals are init to NULL, it seems cleaner)
- remove check if (pwalletMain) in Shutdown() as delete is valid even if
  pwalletMain is NULL
This commit is contained in:
Philip Kaufmann 2014-09-25 09:03:30 +02:00
parent b50e5fe099
commit 20a11ffabf
1 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,7 @@ using namespace boost;
using namespace std; using namespace std;
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
CWallet* pwalletMain; CWallet* pwalletMain = NULL;
#endif #endif
#ifdef WIN32 #ifdef WIN32
@ -109,7 +109,7 @@ bool ShutdownRequested()
return fRequestShutdown; return fRequestShutdown;
} }
static CCoinsViewDB *pcoinsdbview; static CCoinsViewDB *pcoinsdbview = NULL;
void Shutdown() void Shutdown()
{ {
@ -165,8 +165,8 @@ void Shutdown()
#endif #endif
UnregisterAllWallets(); UnregisterAllWallets();
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (pwalletMain) delete pwalletMain;
delete pwalletMain; pwalletMain = NULL;
#endif #endif
LogPrintf("%s: done\n", __func__); LogPrintf("%s: done\n", __func__);
} }
@ -701,6 +701,7 @@ bool AppInit2(boost::thread_group& threadGroup)
fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0; fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0;
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Sanity check // Sanity check
if (!InitSanityCheck()) if (!InitSanityCheck())
return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down.")); return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));