Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak in SCNetworkReachability::set_callback
In SCNetworkReachability::set_callback, an Arc is created called `callback` and then leaked via 'into_raw`. This leak is never fixed causing a memory leak. The fix is to rely on SCNetworkReachabilitySetCallback to call `retain` once and then `release` once when the reference is released via CFRelease. This allows us to drop the `Arc` in `set_callback` while ensuring the reference count for that `Arc` is >0. Fixes #34
- Loading branch information