Implement Drop for Proxy on macOS platform (#1526)
This commit is contained in:
parent
47ff8d61d1
commit
54bc41f68b
2 changed files with 9 additions and 0 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue