From 0b8bd700233d2669b37023892319464f97ad54bb Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 17 Nov 2005 02:35:15 +0000 Subject: [PATCH] Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime. --- src/video/x11/SDL_x11dyn.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index acf2532cf..807d75653 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -104,11 +104,10 @@ int SDL_X11_LoadSymbols(void) #ifdef X11_DYNAMIC x11_handle = SDL_LoadObject(x11_library); x11ext_handle = SDL_LoadObject(x11ext_library); - if ((x11_handle != NULL) && (x11ext_handle != NULL)) { - #define SDL_X11_SYM(r,fn,arg) p##fn = X11_GetSym(#fn, &rc); - #include "SDL_x11sym.h" - #undef SDL_X11_SYM - } + rc = ((x11_handle != NULL) && (x11ext_handle != NULL)); + #define SDL_X11_SYM(r,fn,arg) p##fn = X11_GetSym(#fn, &rc); + #include "SDL_x11sym.h" + #undef SDL_X11_SYM if (!rc) SDL_X11_UnloadSymbols(); /* in case one of these loaded... */