From 349dfbb9f15f06caa768b39ee1f35e1eb07b2c94 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 a5a1f7ea9fad..4f78f35601df 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; }