Bug 1720070 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We now create cdp earlier RemoteAgent.jsm, even if we don't actually start to listen https://searchfox.org/mozilla-central/rev/5227b2bd674d49c0eba365a709d3fb341534f361/remote/components/RemoteAgent.jsm#53

Then when we close() RemoteAgent, we will always call `this.cdp?.stop` which will attempt to destroy this.targetList. However targetList is only created when you start to listen.

Note you can reproduce this by simply starting and quitting Firefox, you will get the following error logged `RemoteAgent	ERROR	unable to stop listener: TypeError: can't access property "destructor", this.targetList is null(chrome://remote/content/cdp/CDP.jsm:92:5) JS Stack trace: stop@CDP.jsm:92:`
We now create cdp earlier RemoteAgent.jsm, even if we don't actually start to listen https://searchfox.org/mozilla-central/rev/5227b2bd674d49c0eba365a709d3fb341534f361/remote/components/RemoteAgent.jsm#53

Then when we close() RemoteAgent, we will always call `this.cdp?.stop` which will attempt to destroy this.targetList. However targetList is only created when you start to listen.

Note you can reproduce this by simply starting and quitting Firefox, you will get the following error logged `RemoteAgent	ERROR	unable to stop listener: TypeError: can't access property "destructor", this.targetList is null(chrome://remote/content/cdp/CDP.jsm:92:5) JS Stack trace: stop@CDP.jsm:92:`

Also note, that this is simply an error log, as we catch all exceptions in RemoteAgent.close (https://searchfox.org/mozilla-central/rev/5227b2bd674d49c0eba365a709d3fb341534f361/remote/components/RemoteAgent.jsm#144-147)

Back to Bug 1720070 Comment 1