fix 2 crashes

This commit is contained in:
UdjinM6 2015-07-03 01:09:14 +03:00
parent d39815db32
commit 189e48328d
3 changed files with 7 additions and 2 deletions

View File

@ -120,7 +120,7 @@ void StartShutdown()
}
bool ShutdownRequested()
{
return fRequestShutdown;
return fRequestShutdown || fRestartRequested;
}
class CCoinsViewErrorCatcher : public CCoinsViewBacked
@ -149,6 +149,7 @@ static CCoinsViewErrorCatcher *pcoinscatcher = NULL;
/** Preparing steps before shutting down or restarting the wallet */
void PrepareShutdown()
{
fRequestShutdown = true; // Needed when we shutdown the wallet
fRestartRequested = true; // Needed when we restart the wallet
LogPrintf("%s: In progress...\n", __func__);
static CCriticalSection cs_Shutdown;

View File

@ -191,6 +191,8 @@ uint256 CMasternode::CalculateScore(int mod, int64_t nBlockHeight)
void CMasternode::Check()
{
if(ShutdownRequested()) return;
//TODO: Random segfault with this line removed
TRY_LOCK(cs_main, lockRecv);
if(!lockRecv) return;

View File

@ -306,7 +306,9 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
void OverviewPage::updateDarksendProgress()
{
if(IsInitialBlockDownload()) return;
if(IsInitialBlockDownload() || ShutdownRequested()) return;
if(!pwalletMain || !walletModel || !walletModel->getOptionsModel()) return;
int64_t nBalance = pwalletMain->GetBalance();
QString strAmountAndRounds;