Bug 1269961 - Remove listeners from RemotePageManager before invoking Unload (r=mconley)
authorBill McCloskey <billm@mozilla.com>
Tue, 03 May 2016 20:08:33 -0700
changeset 296143 e930d26502a6cae04fe86939637d0348a86fcf10
parent 296142 b9482cba39f34ac1fb886a3e73c9b2f991645620
child 296144 3a9efc13a56c50c390f7db2481b585ffe78269ec
push id76219
push userwmccloskey@mozilla.com
push dateWed, 04 May 2016 22:09:57 +0000
treeherdermozilla-inbound@3a9efc13a56c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1269961
milestone49.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 1269961 - Remove listeners from RemotePageManager before invoking Unload (r=mconley)
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);
     }