OneShotPostRefreshObserver can possibly leak and also leak presShell
Categories
(Core :: Layout, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: sefeng211, Assigned: sefeng211)
Details
Attachments
(1 file)
We added it as a raw pointer to the observer array here https://searchfox.org/mozilla-central/rev/0bcf81557b89e7757c44e25bb4bc7f4cb8619dc9/dom/base/nsDOMWindowUtils.cpp#2791 and https://searchfox.org/mozilla-central/source/layout/xul/nsSliderFrame.cpp#994, and this object will only delete itself if DidRefresh
is called which is bad. If it leaks, it'll also leak presShell.
I'll submit a patch to fix it.
Assignee | ||
Comment 1•5 years ago
|
||
OneShotPostRefreshObserver
works as the caller registers it, and
let it deletes itself via the DidRefresh
method. The issue is that
DidRefresh
is not guaranteed to run, and it'll leak PresShell
if it doesn't run.
This patch allows nsPresContext
to store and release the last
registered OneShotPostRefreshObserver
, and converted the existing
usage of OneShotPostRefreshObserver
to use that. So instead of asking
OneShotPostRefreshObserver
to delete itself, we now ask nsPresContext
to release it.
Updated•5 years ago
|
![]() |
||
Comment 3•5 years ago
|
||
bugherder |
Description
•