diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 13e97d09..aba7b488 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5835,13 +5835,21 @@ DWORD WINAPI Notepad_plus::backupDocument(void * /*param*/) bool isSnapshotMode = true; while (isSnapshotMode) { - size_t timer = NppParameters::getInstance()->getNppGUI()._snapshotBackupTiming; + NppParameters *nppParam = NppParameters::getInstance(); + if (!nppParam) + return FALSE; + + size_t timer = nppParam->getNppGUI()._snapshotBackupTiming; if (timer < 1000) timer = 1000; ::Sleep(timer); - isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); + nppParam = NppParameters::getInstance(); + if (!nppParam) + return FALSE; + + isSnapshotMode = nppParam->getNppGUI().isSnapshotMode(); if (!isSnapshotMode) break; diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index dce97bef..5a07a6a6 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -1562,6 +1562,7 @@ void NppParameters::destroyInstance() delete _pXmlBlacklistDoc; delete _pSelf; + _pSelf = NULL; } void NppParameters::setFontList(HWND hWnd)