diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index f0c7058d98f..a59088cf539 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -524,6 +524,8 @@ nsAppShellService::JustCreateTopWindow(nsIWebShellWindow *aParent, *aResult = nsnull; intrinsicallySized = PR_FALSE; window = new nsWebShellWindow(); + // Bump count to one so it doesn't die on us while doing init. + nsCOMPtr tempRef(window); if (!window) rv = NS_ERROR_OUT_OF_MEMORY; else {