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:
troy%netscape.com 1998-11-18 05:31:03 +00:00
Родитель 7716dc91e8
Коммит d3648bb299
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -936,13 +936,11 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
PRBool aAllowPlugins)
{
mChromeMask = aChromeMask;
mAllowPlugins = aAllowPlugins;
mAppShell = aAppShell;
NS_IF_ADDREF(mAppShell);
mPrefs = aPrefs;
NS_IF_ADDREF(mPrefs);
mAllowPlugins = aAllowPlugins;
// Create top level window
nsresult rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWindowIID,
@ -1015,7 +1013,9 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell,
{
mChromeMask = aChromeMask;
mAppShell = aAppShell;
NS_IF_ADDREF(mAppShell);
mPrefs = aPrefs;
NS_IF_ADDREF(mPrefs);
mAllowPlugins = aAllowPlugins;
// Create top level window

Просмотреть файл

@ -205,8 +205,8 @@ public:
nsILabel * mLabel;
//for creating more instances
nsIAppShell* mAppShell; //not addref'ed!
nsIPref* mPrefs; //not addref'ed!
nsIAppShell* mAppShell;
nsIPref* mPrefs;
PRBool mAllowPlugins;
// Global window collection