From f8f11cf10eded056bedc78528ad832c8e95c69c4 Mon Sep 17 00:00:00 2001 From: "jst%mozilla.jstenback.com" Date: Tue, 10 Feb 2004 00:51:35 +0000 Subject: [PATCH] Fixing more bustage. --- extensions/xmlterm/base/mozXMLTermUtils.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extensions/xmlterm/base/mozXMLTermUtils.cpp b/extensions/xmlterm/base/mozXMLTermUtils.cpp index f76da1ac4164..2872c7e3479c 100644 --- a/extensions/xmlterm/base/mozXMLTermUtils.cpp +++ b/extensions/xmlterm/base/mozXMLTermUtils.cpp @@ -91,11 +91,12 @@ mozXMLTermUtils::ConvertDOMWindowToDocShell(nsIDOMWindowInternal* aDOMWindow, if (!globalObject) return NS_ERROR_FAILURE; - globalObject->GetDocShell(aDocShell); - + *aDocShell = globalObject->GetDocShell(); if (!*aDocShell) return NS_ERROR_FAILURE; + NS_ADDREF(*aDocShell); + return NS_OK; } @@ -215,7 +216,10 @@ mozXMLTermUtils::GetScriptContext(nsIDOMDocument* aDOMDocument, if (!scriptGlobalObject) return NS_ERROR_FAILURE; - return scriptGlobalObject->GetContext(aScriptContext); + *aScriptContext = scriptGlobalObject->GetContext(); + NS_IF_ADDREF(*aScriptContext); + + return NS_OK; }