Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixes #1815, don't release the LocalRef returned by SDL_AndroidGetAct…
Browse files Browse the repository at this point in the history
…ivity
  • Loading branch information
gabomdq committed Apr 22, 2013
1 parent e529f20 commit bfd5036
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/android/SDL_android.cpp
Expand Up @@ -1130,13 +1130,18 @@ extern "C" void *SDL_AndroidGetJNIEnv()
return Android_JNI_GetEnv();
}

/*
* The jobject returned by SDL_AndroidGetActivity is a local reference.
* It is the caller's responsibility to properly release it
* (using LocalReferenceHolder or manually with env->DeleteLocalRef)
*/

extern "C" void *SDL_AndroidGetActivity()
{
LocalReferenceHolder refs(__FUNCTION__);
jmethodID mid;

JNIEnv *env = Android_JNI_GetEnv();
if (!refs.init(env)) {
if (!env) {
return NULL;
}

Expand Down

0 comments on commit bfd5036

Please sign in to comment.