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) 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