Leak fixing. CreateNewTopLevel window returns an AddReffed window. You must release it. Also added comments to get the author to think about ownership.

This commit is contained in:
sfraser%netscape.com 1999-06-19 22:07:48 +00:00
parent b400f22d26
commit 1c9e290085

View File

@ -363,12 +363,11 @@ nsXPInstallManager::BeforeJavascriptEvaluation()
if ( NS_SUCCEEDED(rv) )
{
nsIWebShellWindow *newWindow;
nsCOMPtr<nsIWebShellWindow> newWindow;
rv = appShell->CreateTopLevelWindow( nsnull,
url,
PR_TRUE,
newWindow,
*getter_AddRefs(newWindow),
nsnull,
this, // callbacks??
0,
@ -376,9 +375,7 @@ nsXPInstallManager::BeforeJavascriptEvaluation()
if ( NS_SUCCEEDED( rv ) )
{
mWindow = newWindow;
NS_RELEASE( newWindow );
mWindow = newWindow; // ownership ?
if (mWindow != nsnull)
mWindow->Show(PR_TRUE);
}