Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 17 Nov 2005 02:35:15 +0000
changeset 1171f84c6f1397cd
parent 1170 bb1a52a8d3d6
child 1172 f69f4d25fb20
Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
src/video/x11/SDL_x11dyn.c
     1.1 --- a/src/video/x11/SDL_x11dyn.c	Tue Nov 08 01:34:28 2005 +0000
     1.2 +++ b/src/video/x11/SDL_x11dyn.c	Thu Nov 17 02:35:15 2005 +0000
     1.3 @@ -104,11 +104,10 @@
     1.4  		#ifdef X11_DYNAMIC
     1.5  			x11_handle = SDL_LoadObject(x11_library);
     1.6  			x11ext_handle = SDL_LoadObject(x11ext_library);
     1.7 -			if ((x11_handle != NULL) && (x11ext_handle != NULL)) {
     1.8 -				#define SDL_X11_SYM(r,fn,arg) p##fn = X11_GetSym(#fn, &rc);
     1.9 -				#include "SDL_x11sym.h"
    1.10 -				#undef SDL_X11_SYM
    1.11 -			}
    1.12 +			rc = ((x11_handle != NULL) && (x11ext_handle != NULL));
    1.13 +			#define SDL_X11_SYM(r,fn,arg) p##fn = X11_GetSym(#fn, &rc);
    1.14 +			#include "SDL_x11sym.h"
    1.15 +			#undef SDL_X11_SYM
    1.16  
    1.17  			if (!rc)
    1.18  				SDL_X11_UnloadSymbols();  /* in case one of these loaded... */