semabin::~semabin() on macOS calls release() but never dispatch_release(), so every watch instance leaks a dispatch_semaphore_t.
Current code (detail/wtr/watcher/semabin.hpp):
inline ~semabin() noexcept { this->release(); }
release() only signals the semaphore to wake up waiters. It does not balance the +1 retain from dispatch_semaphore_create(0).
Fix:
inline ~semabin() noexcept
{
this->release();
dispatch_release(this->sem);
}
The project is built as pure C++ (no .mm files, no ARC), so dispatch_release is required here. No #if guards needed for the current build setup.
Impact: Any program that creates and destroys multiple watch objects on macOS will slowly leak GCD semaphores.
semabin::~semabin()on macOS callsrelease()but neverdispatch_release(), so everywatchinstance leaks adispatch_semaphore_t.Current code (
detail/wtr/watcher/semabin.hpp):release()only signals the semaphore to wake up waiters. It does not balance the+1retain fromdispatch_semaphore_create(0).Fix:
The project is built as pure C++ (no
.mmfiles, no ARC), sodispatch_releaseis required here. No#ifguards needed for the current build setup.Impact: Any program that creates and destroys multiple
watchobjects on macOS will slowly leak GCD semaphores.