Closed
Bug 1702823
Opened 4 years ago
Closed 4 years ago
Remove the reference of the function when the listener gets disconnected
Categories
(Core :: Audio/Video: Playback, task, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
89 Branch
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
The problem was discovered in this revision [1] where the listener was still holding the callback function that owns a strong reference to another object. As the reference of that object is still alive even if the listener had explicitly called Disconnect()
, that causes a reference loop and a memory leak.
Assignee | ||
Comment 1•4 years ago
|
||
The callback function itself might contains a strong reference to other object, and that reference should be clear as well when the listener explicity gets revoked, which means we won't trigger the function anymore.
If the reference doen't be clear, then it's possible to cause a memory leak if the reference eventually becomes a cycle.
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/081233f6b52e
Clear callback function after listener gets revoked. r=bryce
Comment 3•4 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox89:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•