[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 17:48:55 PDT 2015


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

--- Comment #8 from kyounga <kyounga.ra at gmail.com> ---
(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.

-- 
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/ed0ad9b4/attachment-0001.html>


More information about the webkit-unassigned mailing list