* Take a global reference to the activity to prevent the reference being GCed
authorTim Angus <tim@blackcompanystudios.co.uk>
Fri, 26 Aug 2011 13:23:40 +0100
changeset 6189 b5a665fbaedc
parent 6188 e82023802002
child 6190 519380462400
* Take a global reference to the activity to prevent the reference being GCed
src/core/android/SDL_android.cpp
--- a/src/core/android/SDL_android.cpp	Sun Jan 08 02:23:37 2012 -0500
+++ b/src/core/android/SDL_android.cpp	Fri Aug 26 13:23:40 2011 +0100
@@ -96,7 +96,7 @@
     __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");