mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 14:21:31 +11:00
Merge pull request #489 from ecoal95/glx-drop
glx: Unbind the context if it's the current one
This commit is contained in:
commit
2d1e503f77
|
@ -179,8 +179,10 @@ unsafe impl Sync for Context {}
|
|||
impl Drop for Context {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
// we don't call MakeCurrent(0, 0) because we are not sure that the context
|
||||
// is still the current one
|
||||
if self.is_current() {
|
||||
self.glx.MakeCurrent(self.display as *mut _, 0, ptr::null_mut());
|
||||
}
|
||||
|
||||
self.glx.DestroyContext(self.display as *mut _, self.context);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue