Bug 1026583 - Avoid sending events for already destroyed actors. r=yulia
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 27 Aug 2018 05:31:48 -0700
changeset 488720 dd0901f47236402523ab635cce63b3da891882a0
parent 488719 c44d81b8909ab05e294a897ec76f02c04b729331
child 488721 7dee3ca1609f27bc1945c5ecef2b9333f776460e
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyulia
bugs1026583
milestone63.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 1026583 - Avoid sending events for already destroyed actors. r=yulia Reviewers: yulia! Tags: #secure-revision Bug #: 1026583 Differential Revision: https://phabricator.services.mozilla.com/D4329 MozReview-Commit-ID: 3485VTbMRqO
devtools/shared/protocol.js
--- a/devtools/shared/protocol.js
+++ b/devtools/shared/protocol.js
@@ -981,16 +981,21 @@ Actor.prototype = extend(Pool.prototype,
   // Existing Actors extending this class expect initialize to contain constructor logic.
   initialize: Actor,
 
   toString: function() {
     return "[Actor " + this.typeName + "/" + this.actorID + "]";
   },
 
   _sendEvent: function(name, request, ...args) {
+    if (!this.actorID) {
+      console.error(`Tried to send a '${name}' event on an already destroyed actor` +
+                    ` '${this.typeName}'`);
+      return;
+    }
     let packet;
     try {
       packet = request.write(args, this);
     } catch (ex) {
       console.error("Error sending event: " + name);
       throw ex;
     }
     packet.from = packet.from || this.actorID;