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 1171 f84c6f1397cd
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
--- a/src/video/x11/SDL_x11dyn.c	Tue Nov 08 01:34:28 2005 +0000
+++ b/src/video/x11/SDL_x11dyn.c	Thu Nov 17 02:35:15 2005 +0000
@@ -104,11 +104,10 @@
 		#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... */