Implement Drop for Proxy on macOS platform (#1526)

This commit is contained in:
Héctor Ramón 2020-04-20 23:48:42 +02:00 committed by GitHub
parent 47ff8d61d1
commit 54bc41f68b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -117,6 +117,14 @@ pub struct Proxy<T> {
unsafe impl<T: Send> Send for Proxy<T> {}
impl<T> Drop for Proxy<T> {
fn drop(&mut self) {
unsafe {
CFRelease(self.source as _);
}
}
}
impl<T> Clone for Proxy<T> {
fn clone(&self) -> Self {
Proxy::new(self.sender.clone())