[webkit-changes] [WebKit/WebKit] 870ff9: ThreadSafeWeakHashSet::contains should return fals...

Alex Christensen noreply at github.com
Thu Aug 10 09:48:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 870ff92b350d53e0305ec0615e67c224792e1fa0
      https://github.com/WebKit/WebKit/commit/870ff92b350d53e0305ec0615e67c224792e1fa0
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-08-10 (Thu, 10 Aug 2023)

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

  Log Message:
  -----------
  ThreadSafeWeakHashSet::contains should return false if object has begun destruction
https://bugs.webkit.org/show_bug.cgi?id=259966
rdar://113608976

Reviewed by Chris Dumez.

In https://github.com/WebKit/WebKit/pull/16413 we found that it returns true, but only if the amortized
cleanup hasn't removed its null ThreadSafeWeakPtr from the map yet.  This is undesirable because the
amortized cleanup shouldn't affect behavior.  To fix this, just make it return false in this case.

* Source/WTF/wtf/ThreadSafeWeakHashSet.h:
* Tools/TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::ObjectAddingAndRemovingItself::~ObjectAddingAndRemovingItself):

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




More information about the webkit-changes mailing list