Backout f5de2f1dd9d7 (bug 804653) due to leaks.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 30 Oct 2012 10:13:08 -0400
changeset 111764 32c7a15c3b1c84c1bd6a2d99731c81f374cdfe82
parent 111763 0ba68f9853917b076fa06178cc455cf3fb956a32
child 111765 876a728f389a3ffb05b7046fdcea0bf23aaea04c
push id17245
push userryanvm@gmail.com
push dateTue, 30 Oct 2012 14:13:53 +0000
treeherdermozilla-inbound@32c7a15c3b1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs804653
milestone19.0a1
backs outf5de2f1dd9d7772f2a775e9a68385a7d10c9457b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout f5de2f1dd9d7 (bug 804653) due to leaks.
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -820,16 +820,20 @@ nsDocShell::~nsDocShell()
 #ifdef DEBUG
     // We're counting the number of |nsDocShells| to help find leaks
     --gNumberOfDocShells;
     if (!PR_GetEnv("MOZ_QUIET")) {
         printf("--DOCSHELL %p == %ld [id = %llu]\n", (void*) this,
                gNumberOfDocShells, mHistoryID);
     }
 #endif
+
+    if (mInPrivateBrowsing) {
+        DecreasePrivateDocShellCount();
+    }
 }
 
 nsresult
 nsDocShell::Init()
 {
     nsresult rv = nsDocLoader::Init();
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -4906,22 +4910,16 @@ nsDocShell::Destroy()
     SetTreeOwner(nullptr);
 
     // required to break ref cycle
     mSecurityUI = nullptr;
 
     // Cancel any timers that were set for this docshell; this is needed
     // to break the cycle between us and the timers.
     CancelRefreshURITimers();
-
-    if (mInPrivateBrowsing) {
-        mInPrivateBrowsing = false;
-        DecreasePrivateDocShellCount();
-    }
-
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetUnscaledDevicePixelsPerCSSPixel(double *aScale)
 {
     if (mParentWidget) {
         *aScale = mParentWidget->GetDefaultScale();