[Webkit-unassigned] [Bug 51914] ElementRareData::m_shadowRoot should not be RefPtr.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 19 00:11:48 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51914


David Levin <levin at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #79396|review?                     |review+
               Flag|                            |




--- Comment #21 from David Levin <levin at chromium.org>  2011-01-19 00:11:48 PST ---
(From update of attachment 79396)
TreeShared is a little magical (the way that ref count goes to zero but it stays alive because it has a parent).

I see how this is finally deleted now.  It happens in removeShadowRoot.  The ref count goes to 1. Here:
   if (RefPtr<Node> oldRoot = data->m_shadowRoot) {

Then the parent is removed and when the "if" is exited, "oldRoot" is deref'ed so the ref count goes to zero and there is no parent so the node is destroyed.

This is a bit tricky, but it seems fine. (I wonder if there should be some comments somewhere about how lifetime is managed in here. It takes some detective work to figure it all out.)

Please make sure to run debug test before submitting (and/or use the commit queue).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list