From 1014242375d438d8e6c7a0585c61b5b4a06282d2 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 2 Sep 2022 22:58:29 +0200 Subject: [PATCH] [darwin][leak] (80 bytes) ROOT LEAK: [80] when pressing Ctrl + ^ in interactive mode (#22368) --- src/platform/Darwin/PlatformManagerImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index 6102d1e599effc..4b82a7460c5fa7 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -52,8 +52,6 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() SuccessOrExit(err); #endif // CHIP_DISABLE_PLATFORM_KVS - mRunLoopSem = dispatch_semaphore_create(0); - // Ensure there is a dispatch queue available static_cast(DeviceLayer::SystemLayer()).SetDispatchQueue(GetWorkQueue()); @@ -127,7 +125,10 @@ void PlatformManagerImpl::_RunEventLoop() // Block on the semaphore till we're signalled to stop by // _StopEventLoopTask() // + mRunLoopSem = dispatch_semaphore_create(0); dispatch_semaphore_wait(mRunLoopSem, DISPATCH_TIME_FOREVER); + dispatch_release(mRunLoopSem); + mRunLoopSem = nullptr; } void PlatformManagerImpl::_Shutdown()