From ee67ab951f5a78db361dcf1cf02c2204426ac6c6 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 11 Nov 2014 13:20:38 +0000 Subject: [PATCH] [BUG_FIXED] Fix crash issue on quit Notepad++ while session snapshot period backup feature is on. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1286 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 12 ++++++++++-- PowerEditor/src/Parameters.cpp | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 13e97d094..aba7b488f 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 dce97bef2..5a07a6a6e 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)