diff --git a/exec.c b/exec.c index 0e415a5e9b..c782e5b6b2 100644 --- a/exec.c +++ b/exec.c @@ -1286,6 +1286,10 @@ void cpu_abort(CPUState *env, const char *fmt, ...) cpu_dump_state(env, stderr, fprintf, 0); #endif va_end(ap); + if (logfile) { + fflush(logfile); + fclose(logfile); + } abort(); }