[Webkit-unassigned] [Bug 152043] [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 11 12:22:13 PST 2017


--- Comment #14 from Michael Catanzaro <mcatanzaro at igalia.com> ---
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))

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170211/6d18ff97/attachment.html>

More information about the webkit-unassigned mailing list