Closed Bug 339477 Opened 19 years ago Closed 19 years ago

tabbrowser.xml's observer destructor never gets called, leaking mTabClipWidth at shutdown

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Firefox 2 beta1

People

(Reporter: ispiked, Assigned: ispiked)

References

()

Details

(Keywords: fixed1.8.1, memory-leak)

Attachments

(1 file, 1 obsolete file)

Found this using dbaron's leak monitor extension. Steps to reproduce: 1. Install the extension. 2. Start Firefox; close Firefox. Results: On shutdown, the following is printed to the console: LeakReport: [+] [leaked object] (8671950) = [object XULElement @ 0x86907d0 (native @ 0x86a4830)] [ ] mTabClipWidth = 140 Expected results: No leak. I put some dumps in the destructor and found that it's never called. This can be solved my making the addObserver call to the pref. hold a weak reference to the observer, but I don't know what the possible side effects of this are.
I'm curious why the destructor isn't being called, but in the absence of a good reason, the weak ref is perfectly acceptable.
Flags: blocking-firefox2+
Target Milestone: --- → Firefox 2 beta1
Attached patch hold weak ref. to observer (obsolete) — Splinter Review
Assignee: nobody → ispiked
Status: NEW → ASSIGNED
Attachment #223702 - Flags: review?(mconnor)
Comment on attachment 223702 [details] [diff] [review] hold weak ref. to observer If we're holding the weak ref, just drop the removeObserver call and I guess the whole destructor
Attachment #223702 - Flags: review?(mconnor) → review-
OK. I had a feeling I should do that, but I wasn't sure.
Attachment #223702 - Attachment is obsolete: true
Attachment #223705 - Flags: review?(mconnor)
Attachment #223705 - Flags: approval-branch-1.8.1?(mconnor)
Attachment #223705 - Flags: review?(mconnor)
Attachment #223705 - Flags: review+
Attachment #223705 - Flags: approval-branch-1.8.1?(mconnor)
Attachment #223705 - Flags: approval-branch-1.8.1+
Whiteboard: [checkin needed]
Patch landed on trunk and 1_8 branch U toolkit/content/widgets/tabbrowser.xml RCS file: /cvsroot/mozilla/toolkit/content/widgets/tabbrowser.xml,v retrieving revision 1.149 retrieving revision 1.150 Checking in toolkit/content/widgets/tabbrowser.xml; /cvsroot/mozilla/toolkit/content/widgets/tabbrowser.xml,v <-- tabbrowser.xml new revision: 1.103.2.42; previous revision: 1.103.2.41
Whiteboard: [checkin needed]
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
see also bug #340547, which contains a supplimental patch for this issue
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: