[Webkit-unassigned] [Bug 146538] Memory leak for a protected element having pending events in ImageLoader

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 2 19:55:15 PDT 2015


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

--- Comment #9 from Brady Eidson <beidson at apple.com> ---
(In reply to comment #8)
> (In reply to comment #6)
> > Comment on attachment 255993 [details]
> > Use RefPtr not calling ref/deref() directly
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=255993&action=review
> > 
> > > Source/WebCore/loader/ImageLoader.cpp:372
> > > -    element().deref();
> > > +    m_protectedElement.clear();
> > 
> > Change this to:
> > m_protectedElement = nullptr;
> > 
> > With this code, people have to ask themselves "what kind of object is this,
> > and what does clear do?"
> > With nullptr assignment, anybody not familiar with the code knows it is a
> > pointer being null'ed out.
> 
> I thought calling clear() is more explicit. Also, I understand your thought.
> I attached a changed patch.
> Thanks for your comment.

FWIW, this discussion spawned https://bugs.webkit.org/show_bug.cgi?id=146556 in which we intend to remove RefPtr::clear altogether :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150703/b648b0e7/attachment.html>


More information about the webkit-unassigned mailing list