Fix win32 window not closing when destroying it

This commit is contained in:
Tomaka17 2014-10-11 20:52:48 +02:00
parent 64bbc4965f
commit 9e9a3ae03a
2 changed files with 4 additions and 0 deletions

View file

@ -239,6 +239,7 @@ impl Window {
impl Drop for Window {
fn drop(&mut self) {
use std::ptr;
unsafe { ffi::PostMessageW(self.window, ffi::WM_DESTROY, 0, 0); }
unsafe { ffi::wgl::MakeCurrent(ptr::null(), ptr::null()); }
unsafe { ffi::wgl::DeleteContext(self.context); }
unsafe { ffi::DestroyWindow(self.window); }