From 2b5e903c382c57f1fbf20a940f392fd92e6710eb Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Fri, 24 Sep 1999 21:03:58 +0000 Subject: [PATCH] Bug #14813 --> we are leaking all nsIURI's that go through here. Using a nsCOMPtr fixes the leak. r=vidur, a=leaf. --- webshell/tests/viewer/nsViewerApp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webshell/tests/viewer/nsViewerApp.cpp b/webshell/tests/viewer/nsViewerApp.cpp index a5a1f7ea9fa..4f78f35601d 100644 --- a/webshell/tests/viewer/nsViewerApp.cpp +++ b/webshell/tests/viewer/nsViewerApp.cpp @@ -1027,7 +1027,8 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow) #else const char * str; #endif - nsresult rv = doc->GetDocumentURL()->GetSpec(&str); + nsCOMPtr uri = dont_AddRef(doc->GetDocumentURL()); + nsresult rv = uri->GetSpec(&str); if (NS_FAILED(rv)) { return rv; }