]> git.sesse.net Git - vlc/commitdiff
XCB global hotkeys: fix X11 connection failure handling
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 3 Nov 2009 19:28:26 +0000 (21:28 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 3 Nov 2009 19:28:26 +0000 (21:28 +0200)
modules/control/globalhotkeys/xcb.c

index 2e51c8de11902fc72cb4ffd0058fff24fb48135b..356f233dd90d291f4e8efa40e1a5f5def454ea00 100644 (file)
@@ -101,7 +101,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_connection = xcb_connect( psz_display, &i_screen_default );
     free( psz_display );
 
-    if( !p_sys->p_connection )
+    if( xcb_connection_has_error( p_sys->p_connection ) )
         goto error;
 
     /* Get the root windows of the default screen */
@@ -142,8 +142,7 @@ static int Open( vlc_object_t *p_this )
 error:
     if( p_sys->p_symbols )
         xcb_key_symbols_free( p_sys->p_symbols );
-    if( p_sys->p_connection )
-        xcb_disconnect( p_sys->p_connection );
+    xcb_disconnect( p_sys->p_connection );
     free( p_sys );
     return VLC_EGENERIC;
 }