Fix log written under wrong condition

pull/10912/head
Don Ho 2021-12-06 18:50:36 +01:00
parent 0f4010eada
commit 5d2fc0d8c0
1 changed files with 2 additions and 3 deletions

View File

@ -1915,7 +1915,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_QUERYENDSESSION: case WM_QUERYENDSESSION:
case WM_CLOSE: case WM_CLOSE:
{ {
NppParameters& nppParam = NppParameters::getInstance();
if (message == WM_QUERYENDSESSION) if (message == WM_QUERYENDSESSION)
{ {
nppParam.queryEndSessionStart(); nppParam.queryEndSessionStart();
@ -2062,7 +2061,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_ENDSESSION: case WM_ENDSESSION:
{ {
if (NppParameters::getInstance().doNppLogNulContentCorruptionIssue()) if (nppParam.isQueryEndSessionStarted() && nppParam.doNppLogNulContentCorruptionIssue())
{ {
generic_string issueFn = nppLogNulContentCorruptionIssue; generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log"); issueFn += TEXT(".log");
@ -2085,7 +2084,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_DESTROY: case WM_DESTROY:
{ {
if (NppParameters::getInstance().doNppLogNulContentCorruptionIssue()) if (nppParam.isQueryEndSessionStarted() && nppParam.doNppLogNulContentCorruptionIssue())
{ {
generic_string issueFn = nppLogNulContentCorruptionIssue; generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log"); issueFn += TEXT(".log");