diff --git a/src/hx/thread/CountingSemaphore.apple.cpp b/src/hx/thread/CountingSemaphore.apple.cpp index 766ef5dce..565a671b1 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; } };