From 499a99bce51e332abd531562254cf6a8131d16f6 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Wed, 25 Apr 2012 14:50:20 +0200 Subject: [PATCH] Bug 700493 - Stop overlay load after document went away, r=bz --- content/xul/document/src/nsXULDocument.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 67872f0c2a6..c295dfcbb8d 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -2762,6 +2762,11 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, // Not there. Initiate a load. PR_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was not cached")); + if (mIsGoingAway) { + PR_LOG(gXULLog, PR_LOG_DEBUG, ("xul: ...and document already destroyed")); + return NS_ERROR_NOT_AVAILABLE; + } + // We'll set the right principal on the proto doc when we get // OnStartRequest from the parser, so just pass in a null principal for // now.