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)
|
void connect_with_java(JNIEnv* env, jobject fb_instance)
|
||||||
{
|
{
|
||||||
JNIEnv e = *env;
|
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;
|
static bool have_class;
|
||||||
|
|
||||||
if (!have_class)
|
if (!have_class)
|
||||||
{
|
{
|
||||||
jclass fb_class = e->GetObjectClass(env, fb_instance);
|
jclass fb_class = e->GetObjectClass(env, fb_instance);
|
||||||
|
@ -123,6 +116,8 @@ Java_org_rockbox_RockboxFramebuffer_surfaceCreated(JNIEnv *env, jobject this,
|
||||||
jobject surfaceholder)
|
jobject surfaceholder)
|
||||||
{
|
{
|
||||||
(void)surfaceholder;
|
(void)surfaceholder;
|
||||||
|
/* Update RockboxFramebuffer_instance */
|
||||||
|
RockboxFramebuffer_instance = (*env)->NewGlobalRef(env, this);
|
||||||
/* possibly a new instance - reconnect */
|
/* possibly a new instance - reconnect */
|
||||||
connect_with_java(env, this);
|
connect_with_java(env, this);
|
||||||
display_on = true;
|
display_on = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue