Permalink
Browse files

ae-bridge: Log error messages if closing libraries fails.

  • Loading branch information...
littleguy77 committed Jan 27, 2015
1 parent 1160306 commit 4f7128db1fee69bfab3244850a7fb5658fe8fb46
Showing with 8 additions and 4 deletions.
  1. +8 −4 jni/ae-bridge/ae_exports.cpp
@@ -82,10 +82,14 @@ extern "C" DECLSPEC void SDLCALL Java_paulscode_android_mupen64plusae_jni_Native
{
// Unload the libraries to ensure that static variables are re-initialized next time
LOGI("Unloading native libraries");
- if (handleFront) dlclose(handleFront);
- if (handleCore) dlclose(handleCore);
- if (handleSDL) dlclose(handleSDL);
- if (handleAEI) dlclose(handleAEI);
+ if (handleFront && !dlclose(handleFront))
+ LOGE("Failed to unload libmupen64plus-ui-console.so");
+ if (handleCore && !dlclose(handleCore))
+ LOGE("Failed to unload libmupen64plus-core.so");
+ if (handleSDL && !dlclose(handleSDL))
+ LOGE("Failed to unload libSDL2.so");
+ if (handleAEI && !dlclose(handleAEI))
+ LOGE("Failed to unload libae-imports.so");
// Construct the library paths
const char *libPath = env->GetStringUTFChars(jlibPath, 0);

0 comments on commit 4f7128d

Please sign in to comment.