* Take a global reference to the activity to prevent the reference being GCed

This commit is contained in:
Tim Angus 2011-08-26 13:23:40 +01:00
parent 296e78b65f
commit 73b21090a2

View file

@ -96,7 +96,7 @@ extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls)
__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
mEnv = env;
mActivityClass = cls;
mActivityClass = (jclass)env->NewGlobalRef(cls);
midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
"createGLContext","(II)Z");