Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c4357d1dbdecfa5938c08bf8e4e7d33fbac6ab03
      
https://github.com/WebKit/WebKit/commit/c4357d1dbdecfa5938c08bf8e4e7d33fbac6ab03
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M Source/WTF/wtf/threads/Signals.cpp
    M Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm
    M Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm

  Log Message:
  -----------
  Release Mach port rights
https://bugs.webkit.org/show_bug.cgi?id=321354
rdar://184386480

Reviewed by Mark Lam.

Several code sites are leaking mach port rights incorrectly.

1. mach_thread_self() retains Mach port rights. Let's just use
   pthread_mach_thread_np(pthread_self()), which does not need to retain
   it.
2. catch_mach_exception_raise_state_identity_protected receives the task
   ID token. When routine succeeds, we need to release the ownership.
3. ResourceUsageThread leaked a mach_thread_self(). Adopt it into a
   MachSendRight instead.

* Source/WTF/wtf/threads/Signals.cpp:
(WTF::hashThreadState):
* Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformCollectCPUData):
* Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm:
(WebPushTool::maybeConnectToService):
(WebPushTool::Connection::connectToService):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to