Skip to content

Commit

Permalink
Avoid destroying the window twice (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMajeri authored and tomaka committed Mar 25, 2018
1 parent 7a19465 commit b40b14f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/platform/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Window, CreationError> {
let title = OsStr::new(&window.title).encode_wide().chain(Some(0).into_iter())
Expand Down

0 comments on commit b40b14f

Please sign in to comment.