summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 19:38:30 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 19:38:30 +0000
commit0b18522cd09921995d130bd451d8288162ea68d9 (patch)
treec783f4eceef658329e75ef1369d697d436a0a4db
parent80a2c803327f60bd81e847a8f1557d516e0a721a (diff)
downloadrockbox-0b18522cd09921995d130bd451d8288162ea68d9.tar.gz
rockbox-0b18522cd09921995d130bd451d8288162ea68d9.zip
Android: delete the global reference in surfaceDestroyed
This gets rid of the lcd_deinit() boilerplate. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29572 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/hosted/android/lcd-android.c12
-rw-r--r--firmware/target/hosted/android/system-android.c7
2 files changed, 5 insertions, 14 deletions
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c
index f9d7917a5e..b1d27280b0 100644
--- a/firmware/target/hosted/android/lcd-android.c
+++ b/firmware/target/hosted/android/lcd-android.c
@@ -87,13 +87,6 @@ void connect_with_java(JNIEnv* env, jobject fb_instance)
87 (jint)LCD_WIDTH, (jint)LCD_HEIGHT, native_buffer); 87 (jint)LCD_WIDTH, (jint)LCD_HEIGHT, native_buffer);
88} 88}
89 89
90void lcd_deinit(void)
91{
92 JNIEnv *env_ptr = getJavaEnvironment();
93
94 (*env_ptr)->DeleteGlobalRef(env_ptr, RockboxFramebuffer_instance);
95}
96
97/* 90/*
98 * Do nothing here and connect with the java object later (if it isn't already) 91 * Do nothing here and connect with the java object later (if it isn't already)
99 */ 92 */
@@ -148,9 +141,12 @@ JNIEXPORT void JNICALL
148Java_org_rockbox_RockboxFramebuffer_surfaceDestroyed(JNIEnv *e, jobject this, 141Java_org_rockbox_RockboxFramebuffer_surfaceDestroyed(JNIEnv *e, jobject this,
149 jobject surfaceholder) 142 jobject surfaceholder)
150{ 143{
151 (void)e; (void)this; (void)surfaceholder; 144 (void)this; (void)surfaceholder;
152 145
153 display_on = false; 146 display_on = false;
147
148 (*e)->DeleteGlobalRef(e, RockboxFramebuffer_instance);
149 RockboxFramebuffer_instance = NULL;
154} 150}
155 151
156bool lcd_active(void) 152bool lcd_active(void)
diff --git a/firmware/target/hosted/android/system-android.c b/firmware/target/hosted/android/system-android.c
index c499631132..8d36198c61 100644
--- a/firmware/target/hosted/android/system-android.c
+++ b/firmware/target/hosted/android/system-android.c
@@ -36,15 +36,10 @@ uintptr_t *stackend;
36 36
37extern int main(void); 37extern int main(void);
38extern void telephony_init_device(void); 38extern void telephony_init_device(void);
39extern void lcd_deinit(void);
40 39
41void system_exception_wait(void) { } 40void system_exception_wait(void) { }
42void system_reboot(void) { } 41void system_reboot(void) { }
43 42void power_off(void) { }
44void power_off(void)
45{
46 lcd_deinit();
47}
48 43
49void system_init(void) 44void system_init(void)
50{ 45{