Open GoogleCodeExporter opened 8 years ago
Well I found the solution after playing around with the code:
In SDL_androidvideo.c:
1-In funtion DemoRenderer_nativeInitJavaCallbacks:
*********Orginal********
JavaRenderer = thiz;
JavaRendererClass = (*JavaEnv)->GetObjectClass(JavaEnv, thiz);
*******Modified*********
JavaRenderer = (*JavaEnv)->NewGlobalRef(JavaEnv,thiz);
JavaRendererClass = (*JavaEnv)->GetObjectClass(JavaEnv, JavaRenderer);
2- In CallJavaExitFromNativePlayerView
******Add this to delete the GlobalReference******
(*JavaEnv)->DeleteGlobalRef(JavaEnv,JavaRenderer);
Also consider in SDL_androidaudio.c adding the line:
(*jniEnv)->DeleteGlobalRef(jniEnv, JavaAudioThread);
for example in function ANDROIDAUD_CloseAudio()
Original comment by pabl...@gmail.com
on 8 Sep 2012 at 1:40
For the moment do not add
(*JavaEnv)->DeleteGlobalRef(JavaEnv,JavaRenderer);
in CallJavaExitFromNativePlayerView
Its causing a JNI_ERROR, I guess must be deleted somewhere else.
Original comment by pabl...@gmail.com
on 8 Sep 2012 at 1:49
[deleted comment]
Original comment by aatrala
on 8 Sep 2012 at 1:53
This problem is reproducible as mentioned. Above mentioned idea is correct for
fixing the problem. Needs to be called at exit. Will be fixed in the next
release.
Original comment by aatrala
on 8 Sep 2012 at 1:57
I think is still necessary to figure out when to call
(*JavaEnv)->DeleteGlobalRef(JavaEnv,JavaRenderer);
in SDL_androidvideo.c
I tried adding it in CallJavaExitFromNativePlayerView but gives a JNI_ERROR
error when back button pressed during playing.
Not Deleting globalref doesn't seem to cause a problem
Original comment by pabl...@gmail.com
on 8 Sep 2012 at 2:05
Original issue reported on code.google.com by
pabl...@gmail.com
on 8 Sep 2012 at 1:06