<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [GStreamer][GL] crash within triggerRepaint"
   href="https://bugs.webkit.org/show_bug.cgi?id=159552#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [GStreamer][GL] crash within triggerRepaint"
   href="https://bugs.webkit.org/show_bug.cgi?id=159552">bug 159552</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=159552#c6">comment #6</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=159552#c4">comment #4</a>)
&gt; &gt; if (isMainThread())
&gt; &gt;     m_player-&gt;sizeChanged();
&gt; &gt; else {
&gt; &gt;     auto weakThis = player.createWeakPtr();
&gt; &gt;     RunLoop::main().dispatch([weakThis]) { 
&gt; &gt;         if (weakThis)
&gt; &gt;             weakThis-&gt;m_player-&gt;sizeChanged();
&gt; &gt;     });
&gt; &gt; }
&gt; 
&gt; I understand the concerns about reducing performance but if there isn't we
&gt; should create a function to do something like:</span >

This is not about performance at all, this is to a void a use after free.

<span class="quote">&gt; {
&gt;      auto weakThis = player.createWeakPtr();
&gt;      RunLoop::main().runNowIfMainThreadOrdispatch([weakThis]) { 
&gt;          if (weakThis)
&gt;              weakThis-&gt;m_player-&gt;sizeChanged();
&gt;      });
&gt; }
&gt; 
&gt; Otherwise I think we are creating these code structures and IMHO it makes
&gt; code hard to read.</span >

That's what the MainThreadNotifier is for, I already agreed with philn to use it.</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>