From 334971d2dcf71819971b405509797f6e927917de Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 21 Feb 2023 15:38:08 +0100 Subject: [PATCH] Finish the traces even if model_finish fails --- src/emu/emu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emu/emu.c b/src/emu/emu.c index 18550c9..73841d7 100644 --- a/src/emu/emu.c +++ b/src/emu/emu.c @@ -178,15 +178,17 @@ emu_finish(struct emu *emu) { emu_stat_report(&emu->stat, &emu->player, 1); + int ret = 0; if (model_finish(&emu->model, emu) != 0) { err("model_finish failed"); - return -1; + ret = -1; } + /* Finish the traces event if the model_finish failed */ if (recorder_finish(&emu->recorder) != 0) { err("recorder_finish failed"); - return -1; + ret = -1; } - return 0; + return ret; }