Closed
Bug 56584
Opened 25 years ago
Closed 25 years ago
ns4xPlugin::CreatePlugin leaks ref to nsMemoryImpl
Categories
(Core Graveyard :: Plug-ins, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
Future
People
(Reporter: dbaron, Assigned: serhunt)
References
Details
(Keywords: memory-leak, Whiteboard: [tind-mlk])
Attachments
(2 files)
|
2.16 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.51 KB,
patch
|
Details | Diff | Splinter Review |
The reference ns4xPlugin::CreatePlugin aquires to the global nsMemoryImpl
through a GetService call seems to be leaked in every run of Mozilla. I'm not
sure where it should be released or why it isn't.
One possibility is that ns4xPlugin::CheckClassInitialized is setting mMalloc to
null without releasing it. But that may or may not be it.
| Reporter | ||
Updated•25 years ago
|
Whiteboard: [tind-mlk]
Comment 1•25 years ago
|
||
Not a Netscape 6 RTM blocker. FUTURE. This bug has been marked Future because
the Netscape engineer it is assigned to is overburdened.
Target Milestone: --- → Future
| Reporter | ||
Comment 2•25 years ago
|
||
The problem is that ns4xPlugin::Shutdown is never called, so mMalloc is never
freed. But it really seems wrong to release a static variable every time
Shutdown is called, although I'm not sure when it's supposed to be called.
| Reporter | ||
Comment 3•25 years ago
|
||
| Reporter | ||
Comment 4•25 years ago
|
||
The above patch fixes the leak, but I'm really not sure what the correct fix is.
What's supposed to happen? Why is mMalloc set to null in
CheckClassInitialized, and why is it currently released in Shutdown?
Please look at the code after the fix for bug 58491 got in. It became global and
not static, but some questions still remain, and I think we still should go with
releasing it in the destructor.
| Reporter | ||
Comment 6•25 years ago
|
||
| Reporter | ||
Comment 7•25 years ago
|
||
I think it should be static so that there aren't name conflicts with other files.
I don't see why either gServMgr or gMalloc was set to null in
CheckClassInitialized, so I took those lines out rather than changing them the
latter to a release. Why were they there?
Comment 8•25 years ago
|
||
The last patch looks ok to me. av, what do you think?
David, I don't know what the intention of the person who nulled gServMgr
and gMalloc was, but I too don't see any reason for doing that. Your patch looks
good and clean to me. r=av or a=av whatever you need to get it in.
Comment 10•25 years ago
|
||
Doesn't C++ default to static scope and lifetime (file scope) unless there is an
extern on the definition as well as on any declarations?
/be
| Reporter | ||
Comment 11•25 years ago
|
||
I'm not sure, but I believe IRIX's compiler doesn't, which is a good reason to
say |static| explicitly.
| Reporter | ||
Comment 12•25 years ago
|
||
From reading C++ section 3.5 paragraphs 3-4, I think objects have internal
linkage only when
* explicitly declared |static|, or
* when declared |const| and not |extern|
Comment 13•25 years ago
|
||
sr=waterson
| Reporter | ||
Comment 14•25 years ago
|
||
Fix checked in 2000-12-08 20:06 PST.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 15•25 years ago
|
||
verified that the patch is in. (rubberstamp) VERIFIED.
Status: RESOLVED → VERIFIED
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•