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