Before displaying the message box, fatal() now calls do_stop() in order to make sure the emulator exit is clean.

This commit is contained in:
OBattler
2018-09-21 03:19:29 +02:00
parent 7d6e60d4b8
commit 6d00b48eef

View File

@@ -8,7 +8,7 @@
* *
* Main emulator module where most things are controlled. * Main emulator module where most things are controlled.
* *
* Version: @(#)pc.c 1.0.78 2018/09/19 * Version: @(#)pc.c 1.0.79 2018/09/21
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -261,6 +261,10 @@ fatal(const char *fmt, ...)
/* Make sure the message does not have a trailing newline. */ /* Make sure the message does not have a trailing newline. */
if ((sp = strchr(temp, '\n')) != NULL) *sp = '\0'; if ((sp = strchr(temp, '\n')) != NULL) *sp = '\0';
/* Cleanly terminate all of the emulator's components so as
to avoid things like threads getting stuck. */
do_stop();
ui_msgbox(MBX_ERROR|MBX_FATAL|MBX_ANSI, temp); ui_msgbox(MBX_ERROR|MBX_FATAL|MBX_ANSI, temp);
fflush(stdlog); fflush(stdlog);