From cb6bfbdb6e501f24f568b24efde83080fb859bae 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 git-svn-id: svn://10.0.0.236/trunk@64824 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsGlobalWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 369fdc4928f..062060b8f0b 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/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;