<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Memory leak for a protected element having pending events in ImageLoader"
   href="https://bugs.webkit.org/show_bug.cgi?id=146538#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Memory leak for a protected element having pending events in ImageLoader"
   href="https://bugs.webkit.org/show_bug.cgi?id=146538">bug 146538</a>
              from <span class="vcard"><a class="email" href="mailto:beidson&#64;apple.com" title="Brady Eidson &lt;beidson&#64;apple.com&gt;"> <span class="fn">Brady Eidson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=146538#c8">comment #8</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=146538#c6">comment #6</a>)
&gt; &gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=255993&amp;action=diff" name="attach_255993" title="Use RefPtr not calling ref/deref() directly">attachment 255993</a> <a href="attachment.cgi?id=255993&amp;action=edit" title="Use RefPtr not calling ref/deref() directly">[details]</a></span>
&gt; &gt; Use RefPtr not calling ref/deref() directly
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; <a href="https://bugs.webkit.org/attachment.cgi?id=255993&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=255993&amp;action=review</a>
&gt; &gt; 
&gt; &gt; &gt; Source/WebCore/loader/ImageLoader.cpp:372
&gt; &gt; &gt; -    element().deref();
&gt; &gt; &gt; +    m_protectedElement.clear();
&gt; &gt; 
&gt; &gt; Change this to:
&gt; &gt; m_protectedElement = nullptr;
&gt; &gt; 
&gt; &gt; With this code, people have to ask themselves &quot;what kind of object is this,
&gt; &gt; and what does clear do?&quot;
&gt; &gt; With nullptr assignment, anybody not familiar with the code knows it is a
&gt; &gt; pointer being null'ed out.
&gt; 
&gt; I thought calling clear() is more explicit. Also, I understand your thought.
&gt; I attached a changed patch.
&gt; Thanks for your comment.</span >

FWIW, this discussion spawned <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - Drop RefPtr::clear() method"
   href="show_bug.cgi?id=146556">https://bugs.webkit.org/show_bug.cgi?id=146556</a> in which we intend to remove RefPtr::clear altogether :)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>