Closed Bug 76114 Opened 23 years ago Closed 13 years ago

leaks in nsJSInstallTriggerGlobal.cpp

Categories

(Core Graveyard :: Installer: XPInstall Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME
Future

People

(Reporter: dbaron, Assigned: slogan)

Details

(Keywords: memory-leak)

In nsJSInstallTriggerGlobal.cpp there are 3 occurrences of the line:

nsCOMPtr<nsIScriptGlobalObject> globalObject = scriptContext->GetGlobalObject();

which is an automatic leak and should probably be replaced by

nsCOMPtr<nsIScriptGlobalObject>
globalObject(dont_AddRef(scriptContext->GetGlobalObject()));

See bug 76091 for a similar problem.
Hmm, looks like a common problem. If this is the case then aren't all the 
"nsIScriptGlobalObject *global = aContext->GetGlobalObject()" places leaks 
also? More leaks than not shown by

http://lxr.mozilla.org/seamonkey/search?string=-%3EGetGlobalObject
On closer inspection many of those spots do a manual release, but there are 
still several other nsCOMPtr<> uses.
The only other ones that look like leaks were the ones in nsCrypto.cpp (which is
now obsolete, I think) and in oji (lcglue.cpp and nsCSecurityContext.cpp).  I
filed bug 76144 on the OJI ones, and I'll hope psm-glue will just go away.
Blocks: 92580
No longer blocks: 92580
Target Milestone: --- → M1
Target Milestone: M1 → Future
QA Contact: jimmykenlee → xpi-engine
Remove the code is one way to fix the bug.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.