Bug 899022, cycle collect WindowRoot's window, r=mccr8
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 08 Aug 2013 21:23:55 +0300
changeset 141944 6b67f2733685bdcf813e10dedf07c0ce5279c91d
parent 141943 82a46209e728e67cdd5da7166fa80a36100273c5
child 141945 429f7afd44799a9442c4747679f0ceacc33aeca0
push id25076
push userryanvm@gmail.com
push dateFri, 09 Aug 2013 23:09:21 +0000
treeherdermozilla-central@cead6eb63964 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs899022
milestone26.0a1
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
Bug 899022, cycle collect WindowRoot's window, r=mccr8
dom/base/nsWindowRoot.cpp
dom/base/nsWindowRoot.h
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -38,17 +38,18 @@ nsWindowRoot::nsWindowRoot(nsPIDOMWindow
 
 nsWindowRoot::~nsWindowRoot()
 {
   if (mListenerManager) {
     mListenerManager->Disconnect();
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_3(nsWindowRoot,
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsWindowRoot,
+                                        mWindow,
                                         mListenerManager,
                                         mPopupNode,
                                         mParent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWindowRoot)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsPIWindowRoot)
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -53,17 +53,17 @@ public:
   virtual mozilla::dom::EventTarget* GetParentTarget() MOZ_OVERRIDE { return mParent; }
   virtual nsIDOMWindow* GetOwnerGlobal() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot,
                                                          nsIDOMEventTarget)
 
 protected:
   // Members
-  nsPIDOMWindow* mWindow; // [Weak]. The window will hold on to us and let go when it dies.
+  nsCOMPtr<nsPIDOMWindow> mWindow;
   nsRefPtr<nsEventListenerManager> mListenerManager; // [Strong]. We own the manager, which owns event listeners attached
                                                       // to us.
 
   nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
 
   nsCOMPtr<mozilla::dom::EventTarget> mParent;
 };