Only run dead thread check on complete emulation

This commit is contained in:
Rodrigo Arias 2023-02-20 19:09:27 +01:00 committed by Rodrigo Arias Mallo
parent 899b82c36f
commit 722e32617a
3 changed files with 9 additions and 1 deletions

View File

@ -127,8 +127,10 @@ emu_step(struct emu *emu)
int ret = player_step(&emu->player);
/* No more events */
if (ret > 0)
if (ret > 0) {
emu->finished = 1;
return +1;
}
/* Error happened */
if (ret < 0) {

View File

@ -30,6 +30,8 @@ struct emu {
struct recorder recorder;
struct emu_stat stat;
int finished;
/* Quick access */
struct stream *stream;
struct emu_ev *ev;

View File

@ -6,6 +6,10 @@
int
ovni_finish(struct emu *emu)
{
/* Skip the check if the we are stopping prematurely */
if (!emu->finished)
return 0;
struct system *sys = &emu->system;
int ret = 0;