Closed
Bug 407818
Opened 17 years ago
Closed 17 years ago
Leak nsGenericDOMDataNode with <ol>, <li>, execCommand("selectall")
Categories
(Core :: DOM: Serializers, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: jruderman)
References
Details
(Keywords: memory-leak, testcase)
Attachments
(2 files, 1 obsolete file)
143 bytes,
text/html
|
Details | |
2.16 KB,
patch
|
jruderman
:
review+
jruderman
:
superreview+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
Loading the testcase makes Firefox leak an nsGenericDOMDataNode and some other stuff (as shown by trace-refcnt). Patch coming up.
Assignee | ||
Comment 1•17 years ago
|
||
The leak was due to currNode->GetPreviousSibling(&currNode); because GetPreviousSibling addrefs before returning and currNode was a raw pointer. This patch makes currNode be an nsCOMPtr. It also introduces a temporary because smaug and NeilAway say it's bad luck to do obj->GetX(getter_AddRefs(obj)); (I guess you could lose your owning reference to the object before its method returns.)
Attachment #292501 -
Flags: superreview?(dbaron)
Attachment #292501 -
Flags: review?(dbaron)
Comment on attachment 292501 [details] [diff] [review] patch Two suggestions: 1) get rid of the variable |node| and just leave currNode -- initialize it the way node is now initialized. 2) move the declaration of |tmp| to one line above its first use. Then it'll go out of scope much faster (less code generated for calling its destructor in various places) and hold unneeded references for less time. r+sr=dbaron with that
Attachment #292501 -
Flags: superreview?(dbaron)
Attachment #292501 -
Flags: superreview+
Attachment #292501 -
Flags: review?(dbaron)
Attachment #292501 -
Flags: review+
Assignee | ||
Comment 3•17 years ago
|
||
Attachment #292501 -
Attachment is obsolete: true
Attachment #292509 -
Flags: superreview+
Attachment #292509 -
Flags: review+
Attachment #292509 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #292509 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 4•17 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•