From ecca7cad66e1892625b40501b77ba2c6e36bcf95 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Fri, 23 Oct 2020 10:24:57 +0000 Subject: [PATCH] Bug 1672778 - [devtools] Avoid trying to send new-source event if the thread actor has been destroyed. r=nchevobbe This may prevent logging a few exception or error messages. But thanks to the other patch of this bug, we should try to stop listening for sources as soon as the thread actor is destroyed. Differential Revision: https://phabricator.services.mozilla.com/D94484 --- devtools/server/actors/thread.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index 81510527ef51..82a6d1e55ae4 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -2042,6 +2042,9 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { // We use executeSoon because we don't want to block those operations // by sending packets in the middle of them. DevToolsUtils.executeSoon(() => { + if (this.isDestroyed()) { + return; + } this.emit("newSource", { source: source.form(), });