[vlc-devel] commit: XCB global hotkeys: fix X11 connection failure handling ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Nov 3 20:28:45 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov  3 21:28:26 2009 +0200| [ed769d221904d20062ec95648e774abd2a43297a] | committer: Rémi Denis-Courmont 

XCB global hotkeys: fix X11 connection failure handling

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed769d221904d20062ec95648e774abd2a43297a
---

 modules/control/globalhotkeys/xcb.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c
index 2e51c8d..356f233 100644
--- a/modules/control/globalhotkeys/xcb.c
+++ b/modules/control/globalhotkeys/xcb.c
@@ -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;
 }




More information about the vlc-devel mailing list