mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-24 02:46:33 +11:00
glx: Unbind the context if it's the current one
This commit is contained in:
parent
4589e4a723
commit
0a1a7208c3
1 changed files with 4 additions and 2 deletions
|
@ -179,8 +179,10 @@ unsafe impl Sync for Context {}
|
||||||
impl Drop for Context {
|
impl Drop for Context {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
// we don't call MakeCurrent(0, 0) because we are not sure that the context
|
if self.is_current() {
|
||||||
// is still the current one
|
self.glx.MakeCurrent(self.display as *mut _, 0, ptr::null_mut());
|
||||||
|
}
|
||||||
|
|
||||||
self.glx.DestroyContext(self.display as *mut _, self.context);
|
self.glx.DestroyContext(self.display as *mut _, self.context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue