Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401174
This commit is contained in:
Ryan C. Gordon 2005-11-17 02:35:15 +00:00
parent 0d1c5d91b8
commit 37c07bd99d

View file

@ -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... */