Closed Bug 1731551 Opened 3 years ago Closed 3 years ago

DevToolsFrame JSWindowActor is leaked via DevToolsServer connectionchange event listener

Categories

(DevTools :: Framework, defect)

defect

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-perf-stability-mvp)

Attachments

(1 file)

We should always unregister this event listener:
https://searchfox.org/mozilla-central/rev/13378066961f195595822d4f543c8ac5b7f46490/devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm#428
when the jswindow actor is destroyed. Instead of doing it only when the very last connection drops.

Whiteboard: dt-perf-stability-mvp

Each time the related WindowGlobal is destroyed, the related target actor and connection will be destroyed.
But the destruction of the previous actor/connection happens after the creation of the new.
So that hasConnection() is always true on reload. On toolbox closing it should become false.

Regardless, we should always unregister the connectionchange.
The server may be destroyed by the very last actor/connection to be destroyed.
We might want to move this code directly into DevToolsServer, that may be clearer...
But that may break non-watcher setup, so better do that once we only support the watcher codepath.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d406b326340e [devtools] Avoid leaking DevToolsFrame JSWindowActor on each reload. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: