Closed
Bug 750953
Opened 12 years ago
Closed 12 years ago
FUEL Window objects create a large number of objects until shutdown
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 16
People
(Reporter: bent.mozilla, Assigned: justin.lebar+bug)
References
Details
(Keywords: memory-leak, Whiteboard: [fixed by bug 750454] [MemShrink:P2])
+++ This bug was initially created as a clone of Bug #750454 +++ Every FUEL Window object that gets created registers itself as a listener on the tabbrowser for 4 different events ("TabOpen", "TabMove", "TabClose", and "TabSelect"). These event listeners never get removed until shutdown. Also, each time one of those events is fired FUEL creates a new BrowserTab object. Of course, every Window and BrowserTab object gets added to the gShutdown array. This makes it really easy to write bloaty code. Consider something innocent like this: setInterval(function() { if (Application.activeWindow.activeTab.uri.spec == "myURL") { alert("Thanks for visiting my page!"); } }, 5000); Now, the example is dumb, but imagine what happens. Each call to Application.activeWindow makes a new FUEL Window object. Each one of those registers as a "TabSelect" listener. The first time the the interval runs we end up with 1 Window and 1 BrowserTab in our gShutdown array. If I select a tab I get one "TabSelect" handler running, which adds another BrowserTab to the gShutdown array. The next time the interval runs we have 2 Window objects and now 3 BrowserTab objects. Then if I select a tab I have 2 "TabSelect" handlers running, each of which adds another BrowserTab object to the gShutdown array. And that's just after 10 seconds. Imagine letting this go all day, and having lots of tab changes, window creation, etc. This is a mess.
Updated•12 years ago
|
Whiteboard: [MemShrink]
Updated•12 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Assignee | ||
Comment 2•12 years ago
|
||
> Was this fixed by bug 750454?
Yes, this should be fixed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Updated•12 years ago
|
Updated•12 years ago
|
Resolution: WORKSFORME → FIXED
Target Milestone: --- → Firefox 16
Updated•12 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•