Skip to content
Browse files
SDL: Fix pthread_key_create failing
  • Loading branch information
Gillou68310 authored and littleguy77 committed May 3, 2015
1 parent 335dfaf commit 1ad68008c9d02592db41ad161ff59cb5e582f8c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
@@ -107,6 +107,11 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
return JNI_VERSION_1_4;

void JNI_OnUnload(JavaVM *vm, void *reserved)

// Called before SDL_main() to initialize JNI bindings
void SDL_Android_Init(JNIEnv* mEnv, jclass cls)
@@ -48,6 +48,7 @@ static void *handleFront; //

// Function types
typedef jint (*pJNI_OnLoad) (JavaVM* vm, void* reserved);
typedef void (*pJNI_OnUnload) (JavaVM *vm, void *reserved);
typedef int (*pAeiInit) (JNIEnv* env, jclass cls);
typedef int (*pSdlInit) (JNIEnv* env, jclass cls);
typedef void (*pSdlSetScreen) (int width, int height, Uint32 format);
@@ -175,6 +176,11 @@ extern "C" DECLSPEC void SDLCALL Java_paulscode_android_mupen64plusae_jni_Native
// Clear stale error messages

// Find and call the JNI_OnUnLoad functions from the SDL2 library
pJNI_OnUnload JNI_OnUnLoad = (pJNI_OnUnload) locateFunction(handleSDL, "SDL2", "JNI_OnUnload");
JNI_OnUnLoad(mVm, mReserved);
JNI_OnUnLoad = NULL;

// Nullify function pointers so that they can no longer be used
aeiInit = NULL;
sdlInit = NULL;

0 comments on commit 1ad6800

Please sign in to comment.