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
This commit is contained in:
Alexandre Poirot 2020-10-23 10:24:57 +00:00
Родитель 2839b0697a
Коммит ecca7cad66
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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(),
});