Closed
Bug 56744
Opened 24 years ago
Closed 24 years ago
CompositeDataSourceImpl::Release doesn't always work
Categories
(Core Graveyard :: RDF, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Keywords: memory-leak)
Attachments
(3 files)
1.77 KB,
patch
|
Details | Diff | Splinter Review | |
1.90 KB,
patch
|
Details | Diff | Splinter Review | |
2.04 KB,
patch
|
Details | Diff | Splinter Review |
If I run ./mozilla -ProfileManager and click Exit, 2 of the 10-11 nsVoidArray leaked (the first two by serial number) are the nsVoidArray that are part of a CompositeDataSourceImpl. This CompositeDataSourceImpl doesn't show up in the leak stats, but it wasn't deleted because CompositeDataSourceImpl::Release doesn't always work. In particular, if mDataSources.Count() == 0, it doesn't |delete this|. The proposed fix I'll attach is just a slightly modified version of my patch to bug 44621. waterson: What do you think?
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: P3 → P2
Target Milestone: --- → mozilla0.9
Comment 2•24 years ago
|
||
looks good; r=waterson
Assignee | ||
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
r=waterson, for real this time!
Comment 5•24 years ago
|
||
would prefer |NS_STATIC_CAST(PRInt32*, &mRefCnt)| in the two places where you use an old-style cast
Assignee | ||
Comment 6•24 years ago
|
||
When I change it to NS_STATIC_CAST(PRInt32 *, ...), I get: /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp: In method `nsrefcnt CompositeDataSourceImpl::Release ()': /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp:572: invalid static_cast from type `nsrefcnt *' to type `PRInt32 *' /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp:586: invalid static_cast from type `nsrefcnt *' to type `PRInt32 *' gmake[2]: *** [nsCompositeDataSource.o] Error 1 If I make the static cast to PRUint32 (which is what nsrefcnt is already, so it's kinda pointless), I get: /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp: In method `nsrefcnt CompositeDataSourceImpl::Release ()': /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp:572: cannot convert `PRUint32 *' to `PRInt32 *' for argument `1' to `PR_AtomicDecrement (PRInt32 *)' /builds/seamonkey/mozilla/rdf/base/src/nsCompositeDataSource.cpp:586: cannot convert `PRUint32 *' to `PRInt32 *' for argument `1' to `PR_AtomicAdd (PRInt32 *, int)' gmake[2]: *** [nsCompositeDataSource.o] Error 1 I'm using RedHat's gcc "2.96". Any better ideas, or should I just leave it as it was?
Comment 7•24 years ago
|
||
scc, did you mean NS_REINTERPRET_CAST? I thought that's what you needed to go between unrelated types...
Assignee | ||
Comment 8•24 years ago
|
||
Comment 9•24 years ago
|
||
Right :-) even though signed and unsigned are convertable to each other, pointers to the two types are unrelated, and a reinterpret cast is required. |NS_STATIC_CAST| was the wrong thing for me to say, sorry. sr=scc
Assignee | ||
Comment 10•24 years ago
|
||
Fix checked in 2000-10-29 13:32-0800.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•