mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-14 03:30:53 +00:00
Fix emulator quit path on Android
This commit is contained in:
parent
29006f9c5c
commit
f2abf4ce35
@ -357,6 +357,13 @@ public class Apple2Activity extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
nativeOnQuit();
|
nativeOnQuit();
|
||||||
|
Apple2Activity.this.finish();
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}).setNegativeButton(R.string.no, null).create();
|
}).setNegativeButton(R.string.no, null).create();
|
||||||
/*mQuitDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
/*mQuitDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||||
|
@ -183,13 +183,13 @@ void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnQuit(JNIEnv *env, jobject
|
|||||||
c_eject_6(0);
|
c_eject_6(0);
|
||||||
c_eject_6(1);
|
c_eject_6(1);
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLED
|
emulator_shutting_down = true;
|
||||||
speaker_destroy();
|
|
||||||
MB_Destroy();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
video_shutdown();
|
video_shutdown();
|
||||||
exit(0);
|
|
||||||
|
pthread_mutex_unlock(&interface_mutex);
|
||||||
|
if (pthread_join(cpu_thread_id, NULL)) {
|
||||||
|
ERRLOG("OOPS: pthread_join of CPU thread ...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnKeyDown(JNIEnv *env, jobject obj, jint keyCode, jint metaState) {
|
void Java_org_deadc0de_apple2ix_Apple2Activity_nativeOnKeyDown(JNIEnv *env, jobject obj, jint keyCode, jint metaState) {
|
||||||
|
@ -621,7 +621,6 @@ static void gldriver_init_common(void) {
|
|||||||
|
|
||||||
static void _gldriver_shutdown(void) {
|
static void _gldriver_shutdown(void) {
|
||||||
// Cleanup all OpenGL objects
|
// Cleanup all OpenGL objects
|
||||||
emulator_shutting_down = true;
|
|
||||||
glDeleteTextures(1, &a2TextureName);
|
glDeleteTextures(1, &a2TextureName);
|
||||||
a2TextureName = UNINITIALIZED_GL;
|
a2TextureName = UNINITIALIZED_GL;
|
||||||
_destroy_VAO(crtVAOName);
|
_destroy_VAO(crtVAOName);
|
||||||
@ -637,7 +636,11 @@ static void gldriver_shutdown(void) {
|
|||||||
#if USE_GLUT
|
#if USE_GLUT
|
||||||
glutLeaveMainLoop();
|
glutLeaveMainLoop();
|
||||||
#else
|
#else
|
||||||
_gldriver_shutdown();
|
# if MOBILE_DEVICE
|
||||||
|
// it could be a temporary backgrounding do nothing here ...
|
||||||
|
# else
|
||||||
|
emulator_shutting_down = true;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -886,6 +889,7 @@ static void gldriver_main_loop(void) {
|
|||||||
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
||||||
glutMainLoop();
|
glutMainLoop();
|
||||||
LOG("GLUT main loop finished...");
|
LOG("GLUT main loop finished...");
|
||||||
|
emulator_shutting_down = true;
|
||||||
_gldriver_shutdown();
|
_gldriver_shutdown();
|
||||||
#endif
|
#endif
|
||||||
// fall through if not GLUT
|
// fall through if not GLUT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user