diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 3ea573479..e18835fe1 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1465,11 +1465,18 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa saveSession(currentSession); //Sends WM_DESTROY, Notepad++ will end - ::DestroyWindow(hwnd); + if(Message == WM_CLOSE) + ::DestroyWindow(hwnd); } return TRUE; } + case WM_ENDSESSION: + { + ::DestroyWindow(hwnd); + return TRUE; + } + case WM_DESTROY: { killAllChildren();