Closed Bug 1749004 Opened 3 years ago Closed 3 years ago

call CancelManagedPostRefreshObservers after frame tree is destroyed

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.

nsPresContest::RegisterManagedPostRefreshObserver still lets us add a managed post refresh observer until the mPresShell pointer on the prescontent is nulled out. That means that between the call to CancelManagedPostRefreshObservers and mPresContext->DetachPresShell() (which nulls out the mPresShell pointer on the prescontext) in PresShell::Destroy we can add a managed post refresh observer that will never get removed. Notably, destroying the frame tree happens between these two calls.

So move the CancelManagedPostRefreshObservers call to happen right after we null out the mPresShell pointer on the prescontext.

In bug 1737503 I want to add a managed post refresh observer when we destroy a subdocument frame (it's only interested in the recreate frames case not the destruction case, but not an easy way to tell them apart afaik), so it triggers this bug. The patch and test I have for that bug exercise this scenario.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED
Depends on: 1749100
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d5415ebea193 Call CancelManagedPostRefreshObservers after frame tree is destroyed. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: