Stop mainloop on exit

This commit is contained in:
kichikuou
2017-05-04 20:59:42 +09:00
parent 3c6d7fbf45
commit 38ea296f44
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -144,6 +144,7 @@ typedef struct {
#ifdef ENABLE_SDL
enum { InputNotChecked, InputCheckMissed, HadInput } input_state;
#define BREAK_MAINLOOP (nact->input_state = InputCheckMissed)
#endif
} NACTINFO;
+9
View File
@@ -44,6 +44,9 @@
extern char *mkdtemp (char *template);
#endif
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
#include "nact.h"
#include "portab.h"
@@ -221,7 +224,13 @@ void sys_error(char *format, ...) {
void sys_exit(int code) {
sys35_remove();
#ifdef EMSCRIPTEN
emscripten_cancel_main_loop();
EM_ASM( xsystem35.shell.quit(); );
BREAK_MAINLOOP;
#else
exit(code);
#endif
}
static int check_fontdev(char *devname) {