static __decl_noreturn void __noreturn erl_exit_vv(int n, int flush_async, char *fmt, va_list args1, va_list args2) { unsigned int an; system_cleanup(flush_async); save_statistics(); an = abs(n); if (erts_mtrace_enabled) erts_mtrace_exit((Uint32) an); /* Produce an Erlang core dump if error */ if (((n > 0 && erts_no_crash_dump == 0) || n == ERTS_DUMP_EXIT) && erts_initialized) { erl_crash_dump_v((char*) NULL, 0, fmt, args1); } if (fmt != NULL && *fmt != '\0') erl_error(fmt, args2); /* Print error message. */ sys_tty_reset(n); if (n == ERTS_INTR_EXIT) exit(0); else if (n == ERTS_DUMP_EXIT) ERTS_EXIT_AFTER_DUMP(1); else if (n > 0 || n == ERTS_ABORT_EXIT) abort(); exit(an); }
void system_checkPolls() { APP_STATUS status; while((status=aptGetStatus()) != APP_RUNNING) { if(status == APP_SUSPENDING) { aptReturnToMenu(); } else if(status == APP_PREPARE_SLEEPMODE) { aptSignalReadyForSleep(); aptWaitStatusEvent(); } else if (status == APP_SLEEPMODE) { } else if (status == APP_EXITING) { system_cleanup(); exit(0); } gspWaitForVBlank(); } gfxFlushBuffers(); gfxMySwapBuffers(); consoleCheckFramebuffers(); }
void OnDestroy(AG_Event *event) { // 20120610 GUI関連処理 bEventRunFlag = FALSE; #ifdef _WITH_DEBUGGER Detach_DebugMenu(); #endif /* * サウンド停止 */ StopSnd(); SaveCfg(); AG_ConfigSave(); /* * コンポーネント クリーンアップ */ #ifdef FDDSND CleanFDDSnd(); #endif /* */ CleanSch(); CleanKbd(); CleanSnd(); CleanDraw(); DestroyStatus(); /* * 仮想マシン クリーンアップ */ system_cleanup(); if(pCpuID != NULL) { detachCpuID(pCpuID); pCpuID = NULL; } AG_MutexDestroy(&VMMutex); // AG_Destroy(); #if 0 muntrace(); #endif DiscardTextures(1, &uVramTextureID); DiscardTextures(1, &uNullTextureID); uVramTextureID = 0; XM7_DebugLog(XM7_LOG_INFO, "All resources allocated by VM were freed."); // AG_Destroy(); }
__decl_noreturn void erl_exit(int n, char *fmt,...) { unsigned int an; va_list args; va_start(args, fmt); save_statistics(); system_cleanup(n); an = abs(n); if (erts_mtrace_enabled) erts_mtrace_exit((Uint32) an); /* Produce an Erlang core dump if error */ if (n > 0 && erts_initialized && (erts_no_crash_dump == 0 || n == ERTS_DUMP_EXIT)) { erl_crash_dump_v((char*) NULL, 0, fmt, args); } /* need to reinitialize va_args thing */ va_end(args); va_start(args, fmt); if (fmt != NULL && *fmt != '\0') erl_error(fmt, args); /* Print error message. */ va_end(args); sys_tty_reset(n); if (n == ERTS_INTR_EXIT) exit(0); else if (n == ERTS_DUMP_EXIT) ERTS_EXIT_AFTER_DUMP(1); else if (n > 0 || n == ERTS_ABORT_EXIT) abort(); exit(an); }