diff --git a/appshell/cef_main_window.cpp b/appshell/cef_main_window.cpp index afc9beb29..1909b55c8 100644 --- a/appshell/cef_main_window.cpp +++ b/appshell/cef_main_window.cpp @@ -220,13 +220,6 @@ BOOL cef_main_window::HandleGetMinMaxInfo(LPMINMAXINFO mmi) return TRUE; } -// WM_DESTROY handler -BOOL cef_main_window::HandleDestroy() -{ - ::PostQuitMessage(0); - return TRUE; -} - // WM_CLOSE handler BOOL cef_main_window::HandleClose() { @@ -505,8 +498,7 @@ LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) return 0L; break; case WM_DESTROY: - if (HandleDestroy()) - return 0L; + return 0L; // Do not handle the destroy here. break; case WM_CLOSE: if (HandleClose()) diff --git a/appshell/cef_main_window.h b/appshell/cef_main_window.h index 2f441d8fa..a23f798c0 100644 --- a/appshell/cef_main_window.h +++ b/appshell/cef_main_window.h @@ -52,7 +52,6 @@ class cef_main_window : public cef_host_window BOOL HandleEraseBackground(HDC hdc); BOOL HandleCreate(); BOOL HandleSetFocus(HWND hLosingFocus); - BOOL HandleDestroy(); BOOL HandleClose(); BOOL HandleInitMenuPopup(HMENU hMenuPopup); BOOL HandleCommand(UINT commandId); diff --git a/appshell/client_handler.cpp b/appshell/client_handler.cpp index 417d5b78d..71542f98d 100644 --- a/appshell/client_handler.cpp +++ b/appshell/client_handler.cpp @@ -188,7 +188,12 @@ void ClientHandler::OnBeforeClose(CefRefPtr browser) { } if (m_quitting) { - DispatchCloseToNextBrowser(); + // Changed the logic to call CefQuitMesaageLoop() + // for windows as it was crashing with 2171 CEF. + if (HasWindows()) + DispatchCloseToNextBrowser(); + else + CefQuitMessageLoop(); } }