Bug 1269036 - Also destroy TabParent properly in case of mozbrowser. r=smaug, a=ritu
authorKan-Ru Chen <kanru@kanru.info>
Fri, 02 Sep 2016 16:03:19 +0800
changeset 350094 11228436d644eaa50c2dbfb840e309c61d2bef02
parent 350093 ddd6e3e541f1e406dca4a51fb257e68d3c968644
child 350095 2231ab09a51c3b21dae6fa1627c1a64cfd43b3b0
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, ritu
bugs1269036
milestone50.0a2
Bug 1269036 - Also destroy TabParent properly in case of mozbrowser. r=smaug, a=ritu MozReview-Commit-ID: Co0HL40b4q7
dom/ipc/TabParent.cpp
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2772,16 +2772,19 @@ TabParent::RecvBrowserFrameOpenWindow(PB
                                       TextureFactoryIdentifier* aTextureFactoryIdentifier,
                                       uint64_t* aLayersId)
 {
   BrowserElementParent::OpenWindowResult opened =
     BrowserElementParent::OpenWindowOOP(TabParent::GetFrom(aOpener),
                                         this, aRenderFrame, aURL, aName, aFeatures,
                                         aTextureFactoryIdentifier, aLayersId);
   *aOutWindowOpened = (opened == BrowserElementParent::OPEN_WINDOW_ADDED);
+  if (!*aOutWindowOpened) {
+    Destroy();
+  }
   return true;
 }
 
 bool
 TabParent::RecvRespondStartSwipeEvent(const uint64_t& aInputBlockId,
                                       const bool& aStartSwipe)
 {
   if (nsCOMPtr<nsIWidget> widget = GetWidget()) {