Bug 1530019 - Check if actor.cleanup() exists before trying to call it. r=mconley
authorFelipe Gomes <felipc@gmail.com>
Fri, 22 Feb 2019 19:28:00 -0300
changeset 518603 75f417cfd0d21205c36493cfd1086faacd4a5182
parent 518602 aea45260a0bcb1da32fe474c957c5b1751b636da
child 518604 0e0b4b2f297307d8c3178acca10dc3b4a2c55359
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1530019
milestone67.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 1530019 - Check if actor.cleanup() exists before trying to call it. r=mconley
toolkit/modules/ActorManagerChild.jsm
--- a/toolkit/modules/ActorManagerChild.jsm
+++ b/toolkit/modules/ActorManagerChild.jsm
@@ -213,20 +213,22 @@ class SingletonDispatcher extends Dispat
     for (let msg of this.messages.keys()) {
       this.mm.removeMessageListener(msg, this);
     }
     for (let [event, listener, options] of this.listeners) {
       this.mm.removeEventListener(event, listener, options);
     }
 
     for (let actor of this.instances.values()) {
-      try {
-        actor.cleanup();
-      } catch (e) {
-        Cu.reportError(e);
+      if (typeof actor.cleanup == "function") {
+        try {
+          actor.cleanup();
+        } catch (e) {
+          Cu.reportError(e);
+        }
       }
     }
 
     this.listeners = [];
   }
 
   get window() {
     return this._window.get();