From 7d198d21179d95412f9a23ba1a6fa8c34f076072 Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Sat, 1 Apr 2000 00:33:10 +0000 Subject: [PATCH] hold an extra ref on mContext while we are calling GC. a=leaf to checkin while tree is closed --- dom/src/base/nsGlobalWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index 369fdc4928f1..062060b8f0b9 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -253,7 +253,11 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument *aDocument) mDocument = nsnull; // Forces Release if(mContext) - mContext->GC(); + { + // Add an extra ref in case we release mContext during GC. + nsCOMPtr kungFuDeathGrip = mContext; + kungFuDeathGrip->GC(); + } mDocument = aDocument;