Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac976a6da88c92945dd495cc2a204d89a4953fe9
      
https://github.com/WebKit/WebKit/commit/ac976a6da88c92945dd495cc2a204d89a4953fe9
  Author: Jean-Yves Avenard <j...@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@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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to