File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ impl XcbConnection {
4040 let xcb_connection = unsafe { xlib_xcb:: XGetXCBConnection ( dpy) } ;
4141 assert ! ( !xcb_connection. is_null( ) ) ;
4242 let screen = unsafe { xlib:: XDefaultScreen ( dpy) } as usize ;
43- let conn = unsafe { XCBConnection :: from_raw_xcb_connection ( xcb_connection, true ) ? } ;
43+ let conn = unsafe { XCBConnection :: from_raw_xcb_connection ( xcb_connection, false ) ? } ;
4444 unsafe {
4545 xlib_xcb:: XSetEventQueueOwner ( dpy, xlib_xcb:: XEventQueueOwner :: XCBOwnsEventQueue )
4646 } ;
@@ -119,3 +119,11 @@ impl XcbConnection {
119119 & self . conn . setup ( ) . roots [ self . screen ]
120120 }
121121}
122+
123+ impl Drop for XcbConnection {
124+ fn drop ( & mut self ) {
125+ unsafe {
126+ xlib:: XCloseDisplay ( self . dpy ) ;
127+ }
128+ }
129+ }
You can’t perform that action at this time.
0 commit comments