<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer][GL] crash within triggerRepaint"
   href="https://bugs.webkit.org/show_bug.cgi?id=159552#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [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:calvaris&#64;igalia.com" title="Xabier Rodríguez Calvar &lt;calvaris&#64;igalia.com&gt;"> <span class="fn">Xabier Rodríguez Calvar</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=159552#c4">comment #4</a>)
<span class="quote">&gt; if (isMainThread())
&gt;     m_player-&gt;sizeChanged();
&gt; else {
&gt;     auto weakThis = player.createWeakPtr();
&gt;     RunLoop::main().dispatch([weakThis]) { 
&gt;         if (weakThis)
&gt;             weakThis-&gt;m_player-&gt;sizeChanged();
&gt;     });
&gt; }</span >

I understand the concerns about reducing performance but if there isn't we should create a function to do something like:

{
     auto weakThis = player.createWeakPtr();
     RunLoop::main().runNowIfMainThreadOrdispatch([weakThis]) { 
         if (weakThis)
             weakThis-&gt;m_player-&gt;sizeChanged();
     });
}

Otherwise I think we are creating these code structures and IMHO it makes code hard to read.</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>