From 1c4ac900c26d5d19124f23d1b4b5d76c1b959a75 Mon Sep 17 00:00:00 2001 From: "kmcclusk%netscape.com" Date: Wed, 29 Jul 1998 20:04:05 +0000 Subject: [PATCH] Added check in CreateInstance to see if QueryObject returns NS_OK. If it doesn't then release the interface. --- widget/src/motif/nsWidgetFactory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widget/src/motif/nsWidgetFactory.cpp b/widget/src/motif/nsWidgetFactory.cpp index 176b9c897fc..109baaaf1be 100644 --- a/widget/src/motif/nsWidgetFactory.cpp +++ b/widget/src/motif/nsWidgetFactory.cpp @@ -200,6 +200,9 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, if (res != NS_OK) { delete inst ; } + else { + NS_RELEASE(inst); + } return res; }