Prevent duplicate Setting objects from being created
Categories
(Firefox :: Settings UI, defect, P3)
Tracking
()
People
(Reporter: mstriemer, Assigned: mstriemer, NeedInfo)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(1 file, 1 obsolete file)
In development we encountered a memory leak due to a Setting being registered multiple times (duplicate id). The Preferences.addSetting() method takes a SettingConfig and creates a Setting for it, but it does not perform any checks that this Setting hasn't been created already
Generally this doesn't cause any problems so it went unnoticed (likely the DOM node is connected to the first Setting and the additional Settings that get created just sit around without being accessed). However if the Setting has a setup() function, then we only call the teardown() for the last created Setting with that id. This causes a window leak if the setup() registers an observer.
It looks like we have a few places where we've accidentally registered the same id for multiple Settings. They all look benign and are likely consuming a little more memory than necessary, but they're simple wrappers for the same Preference object.
Updated•6 months ago
|
| Assignee | ||
Comment 1•6 months ago
|
||
Comment 2•5 months ago
|
||
:scunnane - hi as a heads-up this bug has been moved to be post-MVP and since the blocker is fixed, we're working on the basis this isn't a blocker any more but shout if that's not the case.
Comment 3•5 months ago
|
||
Thanks for the head's up, Stuart. Not a blocker for any of the search settings work anymore - I landed a patch a while back that prevented creating extra Settings objects.
| Assignee | ||
Comment 4•4 months ago
|
||
Updated•4 months ago
|
Comment 5•3 months ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 1 week.
:mstriemer, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Updated•1 month ago
|
Description
•