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.
authorSam Lantinga <slouken@libsdl.org>
Thu, 13 Feb 2014 11:05:26 -0800
changeset 8211 089bc02a5e4b
parent 8210 581caa876b2e
child 8212 d278747da408
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
--- a/src/loadso/windows/SDL_sysloadso.c	Thu Feb 13 11:05:24 2014 -0800
+++ b/src/loadso/windows/SDL_sysloadso.c	Thu Feb 13 11:05:26 2014 -0800
@@ -55,7 +55,8 @@
 	/* 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);