Skip to content

Commit 9ee6f99

Browse files
committed
Invalidate display link when dropping OsWindow
Instead of trying to remove from runloop, as this could crash on some systems
1 parent 8c903a8 commit 9ee6f99

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

plugin-canvas/src/platform/mac/window.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,7 @@ impl OsWindowInterface for OsWindow {
275275
impl Drop for OsWindow {
276276
fn drop(&mut self) {
277277
if let Some(display_link) = self.display_link.borrow_mut().take() {
278-
unsafe {
279-
display_link.removeFromRunLoop_forMode(&NSRunLoop::mainRunLoop(), NSDefaultRunLoopMode)
280-
};
278+
display_link.invalidate();
281279
}
282280

283281
if let Some(timer) = self.timer.borrow_mut().take() {

0 commit comments

Comments
 (0)