diff --git a/xpfc/shell/src/nsShellInstance.cpp b/xpfc/shell/src/nsShellInstance.cpp index 4ac691ef2d9b..43f3b9faff20 100644 --- a/xpfc/shell/src/nsShellInstance.cpp +++ b/xpfc/shell/src/nsShellInstance.cpp @@ -420,7 +420,7 @@ nsresult nsShellInstance::ExitApplication() { #ifdef NS_WIN32 - PostQuitMessage(0); + ::PostMessage((HWND)GetApplicationWindowNativeInstance(),WM_CLOSE,0,0L); #endif return NS_OK; } @@ -525,6 +525,9 @@ nsEventStatus PR_CALLBACK HandleEventApplication(nsGUIEvent *aEvent) } + } else if ((aEvent->message == NS_DESTROY) && (gShellInstance->GetApplicationWidget() == aEvent->widget)) + { + ::PostQuitMessage(0); } return (gShellInstance->GetApplicationShell()->HandleEvent(aEvent));