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
This commit is contained in:
emaijala%kolumbus.fi
2005-10-15 18:18:42 +00:00
parent 9aaf107cb5
commit e6862f2295

View File

@@ -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);
}
}