From e6862f22953cc1935316aebbdfc2fe1d62d64e7b Mon Sep 17 00:00:00 2001 From: "emaijala%kolumbus.fi" Date: Sat, 15 Oct 2005 18:18:42 +0000 Subject: [PATCH] Fix for bug 307563: download windows remain in "zombie" status after opening (and other similar problems) r+sr=roc a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@182316 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsToolkit.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mozilla/widget/src/windows/nsToolkit.cpp b/mozilla/widget/src/windows/nsToolkit.cpp index 89708ee1f7d..97c74ac473c 100644 --- a/mozilla/widget/src/windows/nsToolkit.cpp +++ b/mozilla/widget/src/windows/nsToolkit.cpp @@ -937,6 +937,8 @@ MouseTrailer::MouseTrailer() : mHoldMouseWindow(nsnull), mCaptureWindow(nsnull), MouseTrailer::~MouseTrailer() { DestroyTimer(); + NS_IF_RELEASE(mHoldMouseWindow); + NS_IF_RELEASE(mCaptureWindow); } //------------------------------------------------------------------------- // @@ -949,6 +951,7 @@ void MouseTrailer::SetMouseTrailerWindow(nsWindow * aNSWin) // Make sure TimerProc is fired at least once for the old window TimerProc(nsnull, nsnull); } + NS_IF_RELEASE(mHoldMouseWindow); mHoldMouseWindow = topWin; CreateTimer(); } @@ -988,6 +991,7 @@ void MouseTrailer::DestroyTimer() //------------------------------------------------------------------------- void MouseTrailer::SetCaptureWindow(nsWindow * aNSWin) { + NS_IF_RELEASE(mCaptureWindow); mCaptureWindow = aNSWin ? aNSWin->GetTopLevelWindow() : nsnull; if (nsnull != mCaptureWindow) { mIsInCaptureMode = PR_TRUE; @@ -1013,7 +1017,7 @@ void MouseTrailer::TimerProc(nsITimer* aTimer, void* aClosure) // The mHoldMouse could be bad from rolling over the frame, so clear // it if we were capturing and now this is the first timer call back // since we canceled the capture - mSingleton.mHoldMouseWindow = nsnull; + NS_IF_RELEASE(mSingleton.mHoldMouseWindow); mSingleton.mIsInCaptureMode = PR_FALSE; return; } @@ -1041,12 +1045,12 @@ void MouseTrailer::TimerProc(nsITimer* aTimer, void* aClosure) // we are out of this window and of any window, destroy timer mSingleton.DestroyTimer(); - mSingleton.mHoldMouseWindow = nsnull; + NS_IF_RELEASE(mSingleton.mHoldMouseWindow); } } } else { mSingleton.DestroyTimer(); - mSingleton.mHoldMouseWindow = nsnull; + NS_IF_RELEASE(mSingleton.mHoldMouseWindow); } }