<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate"
   href="https://bugs.webkit.org/show_bug.cgi?id=152043#c22">Comment # 22</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate"
   href="https://bugs.webkit.org/show_bug.cgi?id=152043">bug 152043</a>
              from <span class="vcard"><a class="email" href="mailto:mcatanzaro&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
        <pre>Can we get rid of the WeakPtrFactory, then?

(In reply to <a href="show_bug.cgi?id=152043#c14">comment #14</a>)
<span class="quote">&gt; I don't think MainThreadNotifier should be using a WeakPtrFactory at all.
&gt; Currently if the MainThreadNotifier is destroyed after (or during) a call to
&gt; MainThreadNotifier::notify() but before the callback dispatches on the main
&gt; thread, the callback will be implicitly canceled, even if the caller never
&gt; called MainThreadNotifier::cancelPendingNotifications. That seems like
&gt; fertile ground for subtle bugs. Shouldn't it be using a protector RefPtr to
&gt; keep itself alive until the callback is dispatched, rather than a weak
&gt; pointer? If the callback would be unsafe to dispatch after the destruction
&gt; of the MainThreadNotifier, then it should be canceled explicitly, right?
&gt; 
&gt; Note that here removePendingNotification() will return false if the
&gt; notification has been explicitly canceled, it's kinda subtle:
&gt; 
&gt; RunLoop::main().dispatch([weakThis, notificationType, callback] {
&gt;     if (weakThis &amp;&amp; weakThis-&gt;removePendingNotification(notificationType))
&gt;         callback();
&gt; });</span ></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>