changeset 1171:f84c6f1397cd

Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 17 Nov 2005 02:35:15 +0000
parents bb1a52a8d3d6
children f69f4d25fb20
files src/video/x11/SDL_x11dyn.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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... */