From 567b5ba8e9732edf2fb8a1a53937a3a4c8c2cc77 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 13 Feb 2014 11:05:26 -0800 Subject: [PATCH] As part of Jorgen's code review of this function I added a call to LoadLibrary so the refcounts would be consistent between Windows and Posix. Then I forgot to include the check that the thing was actually loaded and caused it to be loaded all the time. Oops. CR: AaronL --- src/loadso/windows/SDL_sysloadso.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/loadso/windows/SDL_sysloadso.c b/src/loadso/windows/SDL_sysloadso.c index 4ff36af0e..ac870d90b 100644 --- a/src/loadso/windows/SDL_sysloadso.c +++ b/src/loadso/windows/SDL_sysloadso.c @@ -55,7 +55,8 @@ SDL_GetLoadedObject(const char *sofile) /* if we got a handle, call LoadLibrary to get * it again with the ref count incremented. * We do this to match the dlopen version of this function */ - handle = (void *)LoadLibrary( tstr ); + if( handle != NULL ) + handle = (void *)LoadLibrary( tstr ); SDL_free(tstr);