[webkit-reviews] review denied: [Bug 115033] Add move semantics to RefPtr : [Attachment 199236] patch v2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 23 08:04:11 PDT 2013


Anders Carlsson <andersca at apple.com> has denied Mikhail Pozdnyakov
<mikhail.pozdnyakov at intel.com>'s request for review:
Bug 115033: Add move semantics to RefPtr
https://bugs.webkit.org/show_bug.cgi?id=115033

Attachment 199236: patch v2
https://bugs.webkit.org/attachment.cgi?id=199236&action=review

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=199236&action=review


> Source/WTF/wtf/RefPtr.h:85
> +	   RefPtr& operator=(RefPtr&& o) { m_ptr = o.release(); }
> +	   template<typename U> RefPtr& operator=(RefPtr<U>&& o) { m_ptr =
o.release(); }

These will cause a memory leak now, and return *this is gone. Let's change them
back into what you had before; something like:

if (m_ptr != o.m_ptr)) {
    derefIfNotNull(m_ptr);
    m_ptr = o.release().leakRef();
}
return *this;


More information about the webkit-reviews mailing list