Bug 1224577 - Fix removing frames from the map so chrome windows aren't leaked from every add-on. r=bz, a=lizzard
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 17 Nov 2015 12:39:08 -0800
changeset 305579 09bfa4e72dbf835a4b370d301044d92ba712cfde
parent 305578 a80ec65ea24c786bf66b3af36558c4b5fda9f878
child 305580 7d63a6f2d3592aafe729a6bc684935d5f80ace5e
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lizzard
bugs1224577
milestone44.0a2
Bug 1224577 - Fix removing frames from the map so chrome windows aren't leaked from every add-on. r=bz, a=lizzard
addon-sdk/source/lib/sdk/remote/parent.js
--- a/addon-sdk/source/lib/sdk/remote/parent.js
+++ b/addon-sdk/source/lib/sdk/remote/parent.js
@@ -181,19 +181,19 @@ const Frame = Class({
     };
 
     frameMap.set(ns(this).messageManager, this);
   },
 
   dispose: function() {
     emit(this, 'detach', this);
     ns(this).messageManager.removeMessageListener('sdk/remote/frame/message', ns(this).messageReceived);
-    ns(this).messageManager = null;
 
     frameMap.delete(ns(this).messageManager);
+    ns(this).messageManager = null;
   },
 
   // Returns the browser or iframe element this frame displays in
   get frameElement() {
     return ns(this).node;
   },
 
   // Returns the process that this frame loads in