Skip to content

Commit

Permalink
[darwin][leak] (80 bytes) ROOT LEAK: <OS_dispatch_semaphore 0x7fd6db9…
Browse files Browse the repository at this point in the history
…28c60> [80] when pressing Ctrl + ^ in interactive mode (#22368)
  • Loading branch information
vivien-apple authored and pull[bot] committed Jul 6, 2023
1 parent 71b717f commit bb0bfeb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/Darwin/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<System::LayerSocketsLoop &>(DeviceLayer::SystemLayer()).SetDispatchQueue(GetWorkQueue());

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit bb0bfeb

Please sign in to comment.