Fixed bug 3702 - Clear error messages of SDL_LoadObject for optional libraries

Simon Hug

Some code in SDL loads libraries with SDL_LoadObject to get more information or use newer APIs. SDL_LoadObject may fail, set an error message and SDL will continue with some fallback code. Since SDL will overwrite the error or exit the function with a return value that indicates success, the error form SDL_LoadObject for the optional stuff might as well be cleared right away.
This commit is contained in:
Sam Lantinga
2017-08-11 10:21:19 -07:00
parent 6e1b11bae4
commit 96305832bc
4 changed files with 9 additions and 1 deletions

View File

@@ -150,6 +150,7 @@ LoadLibSampleRate(void)
SDL_assert(SRC_lib == NULL);
SRC_lib = SDL_LoadObject(SDL_LIBSAMPLERATE_DYNAMIC);
if (!SRC_lib) {
SDL_ClearError();
return SDL_FALSE;
}