From 7ede6d7070ecdea6ec0374e0576e1233f6ace821 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 23 Aug 2005 20:51:22 +0000 Subject: [PATCH] Make sure to remove our mOnloadBlocker from the loadgroup when we're removed from the window. Bug 305639, r+sr=dbaron --- content/base/src/nsDocument.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index a6d4542d1df2..c07cdf58a295 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -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 loadGroup = GetDocumentLoadGroup(); + if (loadGroup) { + loadGroup->RemoveRequest(mOnloadBlocker, nsnull, NS_OK); + } + } } mScriptGlobalObject = aScriptGlobalObject;