mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Avoid destroying the window twice (#388)
This commit is contained in:
parent
7a1946589c
commit
b40b14f37f
|
@ -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)]
|
#[doc(hidden)]
|
||||||
pub struct WindowWrapper(HWND, HDC);
|
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,
|
unsafe fn init(window: WindowAttributes, pl_attribs: PlatformSpecificWindowBuilderAttributes,
|
||||||
inserter: events_loop::Inserter) -> Result<Window, CreationError> {
|
inserter: events_loop::Inserter) -> Result<Window, CreationError> {
|
||||||
let title = OsStr::new(&window.title).encode_wide().chain(Some(0).into_iter())
|
let title = OsStr::new(&window.title).encode_wide().chain(Some(0).into_iter())
|
||||||
|
|
Loading…
Reference in a new issue