mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
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:
parent
b400f22d26
commit
1c9e290085
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user