[webkit-changes] [WebKit/WebKit] ac976a: NativePromise: ASSERTION FAILED: !m_callback

Jean-Yves Avenard noreply at github.com
Sun Feb 11 14:16:50 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac976a6da88c92945dd495cc2a204d89a4953fe9
      https://github.com/WebKit/WebKit/commit/ac976a6da88c92945dd495cc2a204d89a4953fe9
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2024-02-11 (Sun, 11 Feb 2024)

  Changed paths:
    M Source/WTF/wtf/NativePromise.h
    M Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp

  Log Message:
  -----------
  NativePromise: ASSERTION FAILED: !m_callback
https://bugs.webkit.org/show_bug.cgi?id=269160
rdar://122738739

Reviewed by Youenn Fablet.

Following 273828 at main, NativePromiseRequest now inherits from CanMakeWeakPtr,
making it possible to disconnect it while not owning it. If the NativePromiseRequest
was owned by the NativePromise callback, when disconnecting the NativePromiseRequest
the callback would be deleted before the NativePromiseRequest::m_callback member
got cleared, which trigger the assertion.
We clear m_callback prior call disconnect().

Added API test.

* Source/WTF/wtf/NativePromise.h:
(WTF::NativePromiseRequest::disconnect):
* Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/274448@main




More information about the webkit-changes mailing list