Closed
Bug 397022
Opened 18 years ago
Closed 18 years ago
nsCSSValue::Array leak involving overriding declarations of CSS 'content' property
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: dbaron)
References
Details
(Keywords: memory-leak, testcase)
Attachments
(2 files)
217 bytes,
text/html
|
Details | |
1.16 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
roc
:
approval1.9+
|
Details | Diff | Splinter Review |
This testcase causes two nsCSSValue::Array objects to leak.
(Tested with Mac trunk debug, XPCOM_MEM_LEAK_LOG=2.)
Assignee | ||
Comment 1•18 years ago
|
||
The problem is that nsRuleNode::ComputeContentData took the copy-construct codepath to allocate the nsStyleContent but then didn't release the old content->ContentAt().mContent.mCounters .
Assignee | ||
Comment 2•18 years ago
|
||
Except it should have, from reading the code, through ~nsStyleContentData. I must have missed something...
Assignee | ||
Comment 3•18 years ago
|
||
Ah, nsStyleContent::AllocateContents shouldn't have the (aCount != mContentCount) check because we need to run the destructors inside the DELETE_ARRAY_IF.
Assignee | ||
Comment 4•18 years ago
|
||
AllocateQuotes, AllocateCounterIncrements, and AllocateCounterResets should be OK since they allocate objects where assignment does the necessary destruction. (Then again, maybe that ought to be true for nsStyleContentData too.)
Assignee | ||
Comment 5•18 years ago
|
||
This is the simple fix.
The alternative is making nsStyleContentData's members private and making it manage their lifetimes (except it would adopt the string on setting), but that seems like extra cycles and extra code for no present gain.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #281905 -
Flags: superreview?(bzbarsky)
Attachment #281905 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•18 years ago
|
Summary: nsCSSValue::Array leak involving CSS counter → nsCSSValue::Array leak involving overriding declarations of CSS 'content' property
![]() |
||
Comment 6•18 years ago
|
||
Comment on attachment 281905 [details] [diff] [review]
patch
Makes sense. r+sr=bzbarsky
Attachment #281905 -
Flags: superreview?(bzbarsky)
Attachment #281905 -
Flags: superreview+
Attachment #281905 -
Flags: review?(bzbarsky)
Attachment #281905 -
Flags: review+
Assignee | ||
Updated•18 years ago
|
Attachment #281905 -
Flags: approval1.9?
Attachment #281905 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 7•18 years ago
|
||
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•