From b40b14f37f0e9ac2c8a525908461d19d0f97cd9e Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Sun, 25 Mar 2018 21:30:16 +0300 Subject: [PATCH] Avoid destroying the window twice (#388) --- src/platform/windows/window.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/platform/windows/window.rs b/src/platform/windows/window.rs index 764008f0..2211e763 100644 --- a/src/platform/windows/window.rs +++ b/src/platform/windows/window.rs @@ -357,19 +357,10 @@ impl Drop for Window { } } -/// A simple wrapper that destroys the window when it is destroyed. +/// A simple non-owning wrapper around a window. #[doc(hidden)] pub struct WindowWrapper(HWND, HDC); -impl Drop for WindowWrapper { - #[inline] - fn drop(&mut self) { - unsafe { - winuser::DestroyWindow(self.0); - } - } -} - unsafe fn init(window: WindowAttributes, pl_attribs: PlatformSpecificWindowBuilderAttributes, inserter: events_loop::Inserter) -> Result { let title = OsStr::new(&window.title).encode_wide().chain(Some(0).into_iter())