Closed
Bug 296121
Opened 20 years ago
Closed 20 years ago
Leak if document.open() is not followed by data
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: mrbkap)
References
()
Details
(Keywords: memory-leak)
Attachments
(1 file)
|
1.71 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
shaver
:
approval1.8b3+
|
Details | Diff | Splinter Review |
BUILD: Current trunk build STEPS TO REPRODUCE: 1) Start browser with leak logging. 2) Type javascript:document.open() in the URL bar and hit enter (or just click the link in the URL field of this bug). 3) Quit EXPECTED RESULTS: no leaks ACTUAL RESULTS: leak The reason is that we have a cycle document -> parser -> sink -> document for HTML documents. When we get to nsParser::Terminate, mParserContext is null, so we null out the parser in the sink, but that doesn't break the cycle above, just the sink/parser cycle. Just nulling out mSink is also no good, since that will leave a non-null mParser in the document and then when someone tries to document.write we'll end up getting called and not having a sink. Perhaps we should manually call DidBuildModel() on the sink in this case?
| Reporter | ||
Updated•20 years ago
|
Flags: blocking1.8b3?
| Assignee | ||
Comment 1•20 years ago
|
||
Yeah, this fixes the leak in the simplest way possible.
Assignee: parser → mrbkap
Status: NEW → ASSIGNED
Attachment #184961 -
Flags: superreview?(bzbarsky)
Attachment #184961 -
Flags: review?(bzbarsky)
| Reporter | ||
Updated•20 years ago
|
Attachment #184961 -
Flags: superreview?(bzbarsky)
Attachment #184961 -
Flags: superreview+
Attachment #184961 -
Flags: review?(bzbarsky)
Attachment #184961 -
Flags: review+
| Assignee | ||
Comment 2•20 years ago
|
||
Comment on attachment 184961 [details] [diff] [review] break the cycle This fixes a leak.
Attachment #184961 -
Flags: approval1.8b3?
Comment 3•20 years ago
|
||
Comment on attachment 184961 [details] [diff] [review] break the cycle a=shaver
Attachment #184961 -
Flags: approval1.8b3? → approval1.8b3+
| Assignee | ||
Comment 4•20 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Flags: blocking1.8b3?
You need to log in
before you can comment on or make changes to this bug.
Description
•