(&mut self)
| 96 | |
| 97 | impl Drop for Capturer { |
| 98 | fn drop(&mut self) { |
| 99 | unsafe { |
| 100 | let _ = CGDisplayStreamStop(self.stream); |
| 101 | loop { |
| 102 | if *self.stopped.lock().unwrap() { |
| 103 | break; |
| 104 | } |
| 105 | std::thread::sleep(std::time::Duration::from_millis(30)); |
| 106 | } |
| 107 | CFRelease(self.stream); |
| 108 | dispatch_release(self.queue); |
| 109 | } |
| 110 | } |
| 111 | } |