Closed
Bug 58736
Opened 24 years ago
Closed 24 years ago
nsHTTPIndex::CommonInit leaks RDFServiceImpl
Categories
(SeaMonkey :: UI Design, defect, P3)
SeaMonkey
UI Design
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: dbaron, Assigned: mozilla)
Details
(Keywords: memory-leak, Whiteboard: [tind-mlk])
Attachments
(4 files)
1.05 KB,
patch
|
Details | Diff | Splinter Review | |
2.88 KB,
patch
|
Details | Diff | Splinter Review | |
660 bytes,
patch
|
Details | Diff | Splinter Review | |
2.85 KB,
patch
|
Details | Diff | Splinter Review |
nsHTTPIndex::CommonInit leaks references to the RDFService when called multiple
times, since it does a GetService into a global that can already contain an
owning reference. This leak was introduced in revision 1.51 on August 14 to fix
bug 47927.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
If you don't want to do any other cleanup of |Init| and |CommonInit|, and you
think that patch is right, feel free to review the patch and assign the bug to
me...
Updated•24 years ago
|
QA Contact: sairuh → tever
Assignee | ||
Comment 3•24 years ago
|
||
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Due to the nature of nsDirectoryViewer where it can act both as a singleton and
not, the RDF service variable shouldn't be a shared global; instead, make it a
method variable.
dbaron, care to try out the attached diff(s) ?
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
Oops, no need for nsServiceManager::ReleaseService() when using do_GetService...
so use second diff for nsDirectoryViewer.cpp
Reporter | ||
Comment 8•24 years ago
|
||
Patch works fine -- doesn't leak. A few comments:
* weird whitespace stuff going on. Looks like tabs->spaces in some places and
spaces->tabs in others. I guess it should probably be tabs->spaces (but you
don't need to hit stuff you didn't change otherwise).
* No need to null out the nsCOMPtr in the destructor - it will be freed at the
end of the dtor anyway.
* You can use do_GetService(..., &rv) to propagate the return value the way you
did before, rather than make up NS_ERROR_NULL_POINTER.
With that fixed, r=dbaron if you want it.
Assignee | ||
Comment 9•24 years ago
|
||
Chris (Waterson), more r= bug love needed. :)
Comment 10•24 years ago
|
||
[r,sr]=waterson, pick one!
Assignee | ||
Comment 11•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
Status: RESOLVED → VERIFIED
Comment 12•24 years ago
|
||
verified
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•