[Webkit-unassigned] [Bug 36391] Potential for infinite recursion in SharedBuffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 20 13:40:40 PDT 2010


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





--- Comment #5 from Darin Adler <darin at apple.com>  2010-03-20 13:40:40 PST ---
(In reply to comment #3)
> if (m_cfData) {
>  CFDataRef cfData(m_cfData);
>  m_cfData = 0;
>  append(cfData...);
> }
> 
> Will this solve the problem and is it a good way?

Should be OK. I also read Andy's comments. The best idiom would be something
like this:

    RetainPtr<CFDataRef> data;
    data.swap(m_cfData);
    append((const char*)CFDataGetBytePtr(data.get()),
CFDataGetLength(data.get()));

Using "swap" is a technique that avoids any unnecessary CFRetain/CFRelease.
It's critical to use a RetainPtr.

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