We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb258b6 commit 2eccec6Copy full SHA for 2eccec6
1 file changed
plugin-canvas/src/platform/win32/window.rs
@@ -305,9 +305,12 @@ impl Drop for OsWindow {
305
306
unsafe {
307
SetWindowLongPtrW(self.hwnd(), GWLP_USERDATA, 0);
308
- RevokeDragDrop(self.hwnd()).unwrap();
309
- DestroyWindow(self.hwnd()).unwrap();
310
- UnregisterClassW(PCWSTR(self.window_class as _), Some(PLUGIN_HINSTANCE.with(|hinstance| *hinstance))).unwrap();
+
+ // Allow these to fail since we're in Drop
+ // When the plugin instance has been deleted, the HWND might not be valid anymore
311
+ RevokeDragDrop(self.hwnd()).ok();
312
+ DestroyWindow(self.hwnd()).ok();
313
+ UnregisterClassW(PCWSTR(self.window_class as _), Some(PLUGIN_HINSTANCE.with(|hinstance| *hinstance))).ok();
314
}
315
316
0 commit comments