Bug 579959 - TabChild used after Send__delete__. r=Olli.Pettay
authorOleg Romashin <romaxa@gmail.com>
Sat, 24 Jul 2010 09:48:37 +0300
changeset 48159 dfa1076b0ab9a740500c9374a2397fbd22302f42
parent 48158 3433d89bbea949a12ad9f1efc26479ddf2df999c
child 48160 e226c260072364c1202fa40c8ba099640bcfe44c
push id14599
push userromaxa@gmail.com
push dateSat, 24 Jul 2010 06:56:10 +0000
treeherdermozilla-central@dfa1076b0ab9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersOlli.Pettay
bugs579959
milestone2.0b3pre
first release with
nightly win64
dfa1076b0ab9 / 4.0b3pre / 20100724011131 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 579959 - TabChild used after Send__delete__. r=Olli.Pettay
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -473,18 +473,23 @@ TabChild::ActorDestroy(ActorDestroyReaso
   // no longer exists.
   static_cast<nsFrameMessageManager*>
     (mTabChildGlobal->mMessageManager.get())->Disconnect();
   mTabChildGlobal->mMessageManager = nsnull;
 }
 
 TabChild::~TabChild()
 {
+    nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
+    nsCOMPtr<nsIWeakReference> weak =
+      do_GetWeakReference(static_cast<nsSupportsWeakReference*>(this));
+    webBrowser->RemoveWebBrowserListener(weak, NS_GET_IID(nsIWebProgressListener));
+
     DestroyWidget();
-    nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
+
     if (webBrowser) {
       webBrowser->SetContainerWindow(nsnull);
     }
     if (mCx) {
       nsIXPConnect* xpc = nsContentUtils::XPConnect();
       if (xpc) {
          xpc->ReleaseJSContext(mCx, PR_FALSE);
       } else {