Make sure to remove our mOnloadBlocker from the loadgroup when we're removed

from the window.  Bug 305639, r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2005-08-23 20:51:22 +00:00
Родитель 6dfeabd466
Коммит 7ede6d7070
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -2035,6 +2035,14 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject)
// We're detaching from the window. We need to grab a pointer to
// our layout history state now.
mLayoutHistoryState = GetLayoutHistoryState();
// Also make sure to remove our onload blocker now if we haven't done it yet
if (mOnloadBlockCount != 0) {
nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();
if (loadGroup) {
loadGroup->RemoveRequest(mOnloadBlocker, nsnull, NS_OK);
}
}
}
mScriptGlobalObject = aScriptGlobalObject;