Closed Bug 1619621 Opened 5 years ago Closed 5 years ago

Check if reflowFront is destroyed in untrackReflowsInSelection

Categories

(DevTools :: Inspector, task, P3)

task

Tracking

(firefox75 fixed)

RESOLVED FIXED
Firefox 75
Tracking Status
firefox75 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(1 file)

After supporting target switching in the inspector, the reflowFront reference can be destroyed when the corresponding target is destroyed.

https://searchfox.org/mozilla-central/rev/91f6c02fcf4c16f78fdc4417f61f192688294066/devtools/client/inspector/inspector.js#1540-1563

In untrackReflowsInSelection we should improve the guard to protect against cases where the reference is defined, but has been destroyed:

    if (!this.reflowFront) {
      return;
    }

should become

    if (!this.reflowFront || !this.reflowFront.actorID) {
      return;
    }

Alternatively we could nullify the reference, in onTargetDestroyed, but since the whole creation and usage of reflowFront is contained in track/untrackReflowsInSelection, I think it would be nice to keep it this way.

I don't plan to add tests for this because it will be tested with various other inspector target switching tests (from bug 1611096 and bug 1603170 for instance)

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8824039faaa Check if reflowFront is destroyed in untrackReflowsInSelection r=ochameau,daisuke
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: