Bug 1269961 - Remove listeners from RemotePageManager before invoking Unload (r=mconley) a=ritu
authorBill McCloskey <billm@mozilla.com>
Tue, 03 May 2016 20:08:33 -0700
changeset 332722 fa189b73fc82a084dde317e644a36a2c143a58cc
parent 332721 995ecc8dbf0b3a5337784766ee575934cb61df03
child 332723 f1960a9049728175f7d880a9caacc6db3f0e6052
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, ritu
bugs1269961
milestone48.0a2
Bug 1269961 - Remove listeners from RemotePageManager before invoking Unload (r=mconley) a=ritu
toolkit/modules/RemotePageManager.jsm
--- a/toolkit/modules/RemotePageManager.jsm
+++ b/toolkit/modules/RemotePageManager.jsm
@@ -100,20 +100,20 @@ RemotePages.prototype = {
       this.registerPortListener(port, name);
     }
 
     this.listener.callListeners({ target: port, name: "RemotePage:Init" });
   },
 
   // A message has been received from one of the pages
   portMessageReceived: function(message) {
-    this.listener.callListeners(message);
-
     if (message.name == "RemotePage:Unload")
       this.removeMessagePort(message.target);
+
+    this.listener.callListeners(message);
   },
 
   // A page has closed
   removeMessagePort: function(port) {
     for (let name of this.listener.keys()) {
       port.removeMessageListener(name, this.portMessageReceived);
     }