diff --git a/mozilla/widget/src/mac/nsAppShell.cpp b/mozilla/widget/src/mac/nsAppShell.cpp index 0d1f1cd92ed..67655b12a9d 100644 --- a/mozilla/widget/src/mac/nsAppShell.cpp +++ b/mozilla/widget/src/mac/nsAppShell.cpp @@ -55,12 +55,11 @@ void nsAppShell::Create(int* argc, char ** argv) //------------------------------------------------------------------------- nsresult nsAppShell::Run() { -nsMacMessagePump *macpump; + mMacPump = new nsMacMessagePump(mToolKit); + mMacPump->DoMessagePump(); + delete mMacPump; + mMacPump = nsnull; - - macpump = new nsMacMessagePump(mToolKit); - - macpump->DoMessagePump(); //if (mDispatchListener) //mDispatchListener->AfterDispatch(); @@ -75,6 +74,8 @@ nsMacMessagePump *macpump; //------------------------------------------------------------------------- void nsAppShell::Exit() { + if (mMacPump) + mMacPump->StopRunning(); } //------------------------------------------------------------------------- @@ -86,6 +87,7 @@ nsAppShell::nsAppShell() { mRefCnt = 0; mDispatchListener = 0; + mMacPump = nsnull; } //------------------------------------------------------------------------- diff --git a/mozilla/widget/src/mac/nsAppShell.h b/mozilla/widget/src/mac/nsAppShell.h index 1a7d424df08..b7cabb0d926 100644 --- a/mozilla/widget/src/mac/nsAppShell.h +++ b/mozilla/widget/src/mac/nsAppShell.h @@ -38,7 +38,8 @@ class nsAppShell : public nsIAppShell { private: nsDispatchListener *mDispatchListener; - nsToolkit *mToolKit; + nsToolkit *mToolKit; + nsMacMessagePump *mMacPump; // CLASS METHODS private: