зеркало из https://github.com/mozilla/pjs.git
Changed Init() to addref mAppShell and mPrefs, because that's what the other
overloaded Init() does and because the destructor will do a release
This commit is contained in:
Родитель
7716dc91e8
Коммит
d3648bb299
|
@ -936,13 +936,11 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
|
||||||
PRBool aAllowPlugins)
|
PRBool aAllowPlugins)
|
||||||
{
|
{
|
||||||
mChromeMask = aChromeMask;
|
mChromeMask = aChromeMask;
|
||||||
mAllowPlugins = aAllowPlugins;
|
|
||||||
|
|
||||||
mAppShell = aAppShell;
|
mAppShell = aAppShell;
|
||||||
NS_IF_ADDREF(mAppShell);
|
NS_IF_ADDREF(mAppShell);
|
||||||
|
|
||||||
mPrefs = aPrefs;
|
mPrefs = aPrefs;
|
||||||
NS_IF_ADDREF(mPrefs);
|
NS_IF_ADDREF(mPrefs);
|
||||||
|
mAllowPlugins = aAllowPlugins;
|
||||||
|
|
||||||
// Create top level window
|
// Create top level window
|
||||||
nsresult rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWindowIID,
|
nsresult rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWindowIID,
|
||||||
|
@ -1015,7 +1013,9 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
|
||||||
{
|
{
|
||||||
mChromeMask = aChromeMask;
|
mChromeMask = aChromeMask;
|
||||||
mAppShell = aAppShell;
|
mAppShell = aAppShell;
|
||||||
|
NS_IF_ADDREF(mAppShell);
|
||||||
mPrefs = aPrefs;
|
mPrefs = aPrefs;
|
||||||
|
NS_IF_ADDREF(mPrefs);
|
||||||
mAllowPlugins = aAllowPlugins;
|
mAllowPlugins = aAllowPlugins;
|
||||||
|
|
||||||
// Create top level window
|
// Create top level window
|
||||||
|
|
|
@ -205,8 +205,8 @@ public:
|
||||||
nsILabel * mLabel;
|
nsILabel * mLabel;
|
||||||
|
|
||||||
//for creating more instances
|
//for creating more instances
|
||||||
nsIAppShell* mAppShell; //not addref'ed!
|
nsIAppShell* mAppShell;
|
||||||
nsIPref* mPrefs; //not addref'ed!
|
nsIPref* mPrefs;
|
||||||
PRBool mAllowPlugins;
|
PRBool mAllowPlugins;
|
||||||
|
|
||||||
// Global window collection
|
// Global window collection
|
||||||
|
|
Загрузка…
Ссылка в новой задаче