From 789774398ddf925593518764cbe6190299e69c42 Mon Sep 17 00:00:00 2001 From: Aidan Lee Date: Tue, 18 Aug 2026 14:30:46 +0100 Subject: [PATCH 1/2] release dispatch semaphore in finaliser --- src/hx/thread/CountingSemaphore.apple.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hx/thread/CountingSemaphore.apple.cpp b/src/hx/thread/CountingSemaphore.apple.cpp index 766ef5dce..361487224 100644 --- a/src/hx/thread/CountingSemaphore.apple.cpp +++ b/src/hx/thread/CountingSemaphore.apple.cpp @@ -8,7 +8,11 @@ struct hx::thread::CountingSemaphore_obj::Impl static void finalise(hx::Object* obj) { - delete reinterpret_cast(obj)->impl; + auto semaphore = reinterpret_cast(obj); + + dispatch_release(semaphore->impl->semaphore) + + delete semaphore->impl; } }; From 581ad88ad237eff757f016ff31f8d1732e301c81 Mon Sep 17 00:00:00 2001 From: Aidan Lee Date: Tue, 18 Aug 2026 15:18:44 +0100 Subject: [PATCH 2/2] syntax --- src/hx/thread/CountingSemaphore.apple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hx/thread/CountingSemaphore.apple.cpp b/src/hx/thread/CountingSemaphore.apple.cpp index 361487224..565a671b1 100644 --- a/src/hx/thread/CountingSemaphore.apple.cpp +++ b/src/hx/thread/CountingSemaphore.apple.cpp @@ -10,7 +10,7 @@ struct hx::thread::CountingSemaphore_obj::Impl { auto semaphore = reinterpret_cast(obj); - dispatch_release(semaphore->impl->semaphore) + dispatch_release(semaphore->impl->semaphore); delete semaphore->impl; }