From 5d2fc0d8c08e44afec176b3c37987810897e8a5c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 6 Dec 2021 18:50:36 +0100 Subject: [PATCH] Fix log written under wrong condition --- PowerEditor/src/NppBigSwitch.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index c9f1be637..7d7a99251 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1915,7 +1915,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case WM_QUERYENDSESSION: case WM_CLOSE: { - NppParameters& nppParam = NppParameters::getInstance(); if (message == WM_QUERYENDSESSION) { nppParam.queryEndSessionStart(); @@ -2062,7 +2061,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case WM_ENDSESSION: { - if (NppParameters::getInstance().doNppLogNulContentCorruptionIssue()) + if (nppParam.isQueryEndSessionStarted() && nppParam.doNppLogNulContentCorruptionIssue()) { generic_string issueFn = nppLogNulContentCorruptionIssue; issueFn += TEXT(".log"); @@ -2085,7 +2084,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case WM_DESTROY: { - if (NppParameters::getInstance().doNppLogNulContentCorruptionIssue()) + if (nppParam.isQueryEndSessionStarted() && nppParam.doNppLogNulContentCorruptionIssue()) { generic_string issueFn = nppLogNulContentCorruptionIssue; issueFn += TEXT(".log");