Closed Bug 1602700 Opened 5 years ago Closed 5 years ago

Make it clearer that the webConsoleFront destroy method only does the heavy work once

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Firefox 73
Tracking Status
firefox73 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

We could create a destroyer param on it the first time destroy is called, like we do in multiple places in the codebase already.

in fact there's an early return on the truthiness of this._client, which is set to null later in the function, which means we actually only do the "real work" once.
I'll use this bug to add a comment to make this more clear.

Summary: webConsoleFront destroy method is called multiple time while destroying the toolbox → Make it clearer that the webConsoleFront destroy method only does the heavy work once

This only highlights the fact that the front will only
do the heavy work once, since we set the _client property
to null, and the function is guarded against the _client
truthiness.

I filed Bug 1602727 to fix other issues related to incorrect _destroyer patterns in Devtools, leading to target-mixin and toolbox destroy being called several times

(and I just checked, fixing it will avoid calling webconsole front destroy twice on toolbox destroy)

See Also: → 1602727
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/544dbe923092 Add a comment in webconsole front destroy function to make it clearer how it behaves. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: