зеркало из https://github.com/mozilla/gecko-dev.git
Leak fixing. CreateNewTopLevel window returns an AddReffed window. You must release it. Also add comments to get someone to think about ownership.
This commit is contained in:
Родитель
7ec882a272
Коммит
fe65843da7
|
@ -169,12 +169,11 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
|||
if ( NS_SUCCEEDED(rv) )
|
||||
{
|
||||
|
||||
nsIWebShellWindow *newWindow;
|
||||
|
||||
nsCOMPtr<nsIWebShellWindow> newWindow;
|
||||
rv = appShell->CreateTopLevelWindow( nsnull,
|
||||
url,
|
||||
PR_TRUE,
|
||||
newWindow,
|
||||
*getter_AddRefs(newWindow),
|
||||
nsnull,
|
||||
this, // callbacks??
|
||||
0,
|
||||
|
@ -182,9 +181,7 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
|||
|
||||
if ( NS_SUCCEEDED( rv ) )
|
||||
{
|
||||
mWindow = newWindow;
|
||||
NS_RELEASE( newWindow );
|
||||
|
||||
mWindow = newWindow; // ownership????
|
||||
if (mWindow != nsnull)
|
||||
mWindow->Show(PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class nsPrefMigrationProgressDialog : public nsIPrefMigrationProgress, public ns
|
|||
|
||||
private:
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> mDocument;
|
||||
nsCOMPtr<nsIWebShellWindow> mWindow;
|
||||
nsCOMPtr<nsIDOMXULDocument> mDocument; // is this really owned?
|
||||
nsCOMPtr<nsIWebShellWindow> mWindow; // is this really owned?
|
||||
};
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче