Closed Bug 982072 Opened 11 years ago Closed 11 years ago

RegisterStrongMemoryReporter leaks on failure

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mccr8, Assigned: ehsan.akhgari)

References

Details

(Keywords: memory-leak, Whiteboard: [MemShrink])

Attachments

(1 file)

I just noticed this while reading code, and it might be cause of bug 981966 (another possibility is the doomsday scenario, bug 980401). How could we be leaking a memory reporter (OggReporter in this case) without any indication, if it is an ISupports class? Well, one way for that to happen is to do |RegisterStrongMemoryReporter(new WhateverReporter())| and have the call to |do_GetService| fail. The caller expects the register function to deal with it, so we leak, and we never called AddRef or Release on the reporter, so I think it is invisible to the XPCOM leak checker. I haven't checked if this is actually happening for the OggReporter, but we want to fix this problem in any case.
Keywords: mlk
Okay, Nathan pointed out that I was reading the stack incorrectly, so we're not actually leaking a reporter in bug 981966, so I think this isn't actually happening right now. But it would still be good to fix, with at least an NS_ASSERTION or something on failure.
Assignee: nobody → ehsan
Attachment #8389160 - Flags: review?(nfroyd)
Attachment #8389160 - Flags: review?(nfroyd) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Depends on: 984237
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: