Skip to content

Commit

Permalink
Fixed crash when dynamic X11 fails to load system Xlib libraries at r…
Browse files Browse the repository at this point in the history
…untime.
  • Loading branch information
icculus committed Nov 17, 2005
1 parent 0ee4774 commit 0b8bd70
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/video/x11/SDL_x11dyn.c
Expand Up @@ -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... */
Expand Down

0 comments on commit 0b8bd70

Please sign in to comment.