Closed
Bug 686941
Opened 13 years ago
Closed 13 years ago
Consider making nsIDocument::mCachedRootElement a weak pointer
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: khuey, Assigned: khuey)
Details
Attachments
(1 file)
4.56 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Updated•13 years ago
|
Version: unspecified → Trunk
Comment 1•13 years ago
|
||
Seems like that would allow us to make it an Element*.
Assignee | ||
Comment 2•13 years ago
|
||
This makes us store an Element*, at the cost of moving the function into nsDocument.cpp. If that's not acceptable I can go back to the nsIContent*.
Assignee | ||
Comment 3•13 years ago
|
||
Back to an nsINode of course.
Comment 4•13 years ago
|
||
Comment on attachment 560776 [details] [diff] [review] Patch >@@ -1918,17 +1917,16 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns > for (PRInt32 indx = PRInt32(tmp->mChildren.ChildCount()) - 1; > indx >= 0; --indx) { > tmp->mChildren.ChildAt(indx)->UnbindFromTree(); > tmp->mChildren.RemoveChildAt(indx); > } > tmp->mFirstChild = nsnull; > > NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mXPathEvaluatorTearoff) >- NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCachedRootElement) You must add tmp->mCachedRootElement = nsnull; otherwise it may point to a deleted object after unlinking.
Attachment #560776 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 5•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d0dac9811895
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in
before you can comment on or make changes to this bug.
Description
•