From 344db7454bb37c769c9970026fb81f659fb5291d Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Sat, 19 Jun 1999 21:48:53 +0000 Subject: [PATCH] Comments to make the ownership model clearer git-svn-id: svn://10.0.0.236/trunk@35917 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsAppShellService.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index c6b77a0aed5..a0845c63512 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -472,8 +472,12 @@ nsAppShellService::CreateTopLevelWindow(nsIWebShellWindow *aParent, rv = window->Initialize((nsIWebShellWindow *) nsnull, mAppShell, aUrl, anObserver, aCallbacks, aInitialWidth, aInitialHeight); - if (NS_SUCCEEDED(rv)) { + if (NS_SUCCEEDED(rv)) + { + // this does the AddRef of the return value rv = window->QueryInterface(kIWebShellWindowIID, (void **) &aResult); + + // the addref resulting from this is the owning addref for this window RegisterTopLevelWindow(window); if (showWindow) window->Show(PR_TRUE);