From ba7f2a923f769af0d566da2397e7649f57c251f1 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 18 Feb 2015 08:58:37 +0100 Subject: Don't call MakeCurrent(null, null) when destroying --- src/win32/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/win32') diff --git a/src/win32/mod.rs b/src/win32/mod.rs index 8076bcc..e0adb7b 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -277,8 +277,9 @@ impl<'a> Iterator for WaitEventsIterator<'a> { impl Drop for Window { fn drop(&mut self) { use std::ptr; + // we don't call MakeCurrent(0, 0) because we are not sure that the context + // is still the current one unsafe { user32::PostMessageW(self.window, winapi::WM_DESTROY, 0, 0); } - unsafe { gl::wgl::MakeCurrent(ptr::null(), ptr::null()); } unsafe { gl::wgl::DeleteContext(self.context as *const libc::c_void); } unsafe { user32::DestroyWindow(self.window); } } -- cgit v1.2.3