[Webkit-unassigned] [Bug 27001] Fix improper use of PassRefPtr<Node> to RefPtr<Node>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 6 17:55:46 PDT 2009


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





--- Comment #2 from David Kilzer (ddkilzer) <ddkilzer at webkit.org>  2009-07-06 17:55:45 PDT ---
(In reply to comment #1)
> (From update of attachment 32318 [details])
> >         (WebCore::Editor::increaseSelectionListLevelOrdered): Changed
> >         stack-allocated PassRefPtr<Node> to RefPtr<Node> and call
> >         release() on returned object to prevent ref count churn.
> 
> Technically, I don't think there would be refcount churn, since the default
> behavior of PassRefPtr is to give up its reference upon assignment:
> 
>         template <typename U> PassRefPtr(const PassRefPtr<U>& o) :
> m_ptr(o.releaseRef()) { }

I'll adjust the changelog entry.  (If you didn't call release(), though, and
returned the RefPtr<Node> object, I do believe some ref count churn would be
involved creating a PassRefPtr<Node> from a RefPtr<Node>.  That's what I was
referring to when using release().)

-- 
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