File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -241,5 +241,9 @@ impl GlContext {
241241}
242242
243243impl Drop for GlContext {
244- fn drop ( & mut self ) { }
244+ fn drop ( & mut self ) {
245+ unsafe {
246+ glx:: glXDestroyContext ( self . display , self . context ) ;
247+ }
248+ }
245249}
Original file line number Diff line number Diff line change @@ -94,16 +94,17 @@ impl Drop for ParentHandle {
9494}
9595
9696pub ( crate ) struct WindowInner {
97+ // GlContext should be dropped **before** XcbConnection is dropped
98+ #[ cfg( feature = "opengl" ) ]
99+ gl_context : Option < GlContext > ,
100+
97101 pub ( crate ) xcb_connection : XcbConnection ,
98102 window_id : XWindow ,
99103 pub ( crate ) window_info : WindowInfo ,
100104 visual_id : Visualid ,
101105 mouse_cursor : Cell < MouseCursor > ,
102106
103107 pub ( crate ) close_requested : Cell < bool > ,
104-
105- #[ cfg( feature = "opengl" ) ]
106- gl_context : Option < GlContext > ,
107108}
108109
109110pub struct Window < ' a > {
You can’t perform that action at this time.
0 commit comments