forked from len0rd/rockbox
Create GlobalRef in surfaceCreated, in accordance to r29572.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29574 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
00f75c92bf
commit
662ba4868a
1 changed files with 3 additions and 8 deletions
|
@ -46,15 +46,8 @@ static bool display_on;
|
|||
void connect_with_java(JNIEnv* env, jobject fb_instance)
|
||||
{
|
||||
JNIEnv e = *env;
|
||||
/* Update RockboxFramebuffer_instance */
|
||||
if (!e->IsSameObject(env, RockboxFramebuffer_instance, fb_instance)) {
|
||||
if (RockboxFramebuffer_instance != NULL)
|
||||
e->DeleteGlobalRef(env, RockboxFramebuffer_instance);
|
||||
|
||||
RockboxFramebuffer_instance = e->NewGlobalRef(env, fb_instance);
|
||||
}
|
||||
|
||||
static bool have_class;
|
||||
|
||||
if (!have_class)
|
||||
{
|
||||
jclass fb_class = e->GetObjectClass(env, fb_instance);
|
||||
|
@ -123,6 +116,8 @@ Java_org_rockbox_RockboxFramebuffer_surfaceCreated(JNIEnv *env, jobject this,
|
|||
jobject surfaceholder)
|
||||
{
|
||||
(void)surfaceholder;
|
||||
/* Update RockboxFramebuffer_instance */
|
||||
RockboxFramebuffer_instance = (*env)->NewGlobalRef(env, this);
|
||||
/* possibly a new instance - reconnect */
|
||||
connect_with_java(env, this);
|
||||
display_on = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue