Closed Bug 195515 Opened 23 years ago Closed 23 years ago

leak of nsNativeAppSupport object

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

(Keywords: memory-leak)

Attachments

(1 file)

We always leak the nsNativeAppSupport object because of a refcounting error: - The object is initially created with a refcount of 1, by main() - The object is passed to main1(), which assigns it into a nsCOMPtr (refcnt->2) - The object is passed to the nsAppShellService, which stores it into a member variable (refcnt->3) On shutdown: - The appshell service goes away (refcnt->2) - main1() exits, releasing the nsCOMPtr (refcnt->1)
Attached patch patchSplinter Review
use dont_AddRef when assigning into the nsCOMPtr in main1(), since the object is passed in with a refcount of 1.
Appears to have been introduced by lordpixel's checkin for bug 90823.
Comment on attachment 115968 [details] [diff] [review] patch r=bbaetz. Not that it really matters that we leak something which can't be released until main() is ending anyway, but hey....
Attachment #115968 - Flags: review+
Attachment #115968 - Flags: superreview?(jaggernaut)
checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Attachment #115968 - Flags: superreview?(jaggernaut)
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: