Skip to content

Commit d9b0b8d

Browse files
committed
fix: call allegro_exit before exit to avoid rare hang seen on linux
1 parent f64f949 commit d9b0b8d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/launcher/launcher.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ int32_t main(int32_t argc, char* argv[])
256256
//
257257

258258
flush_config_file();
259+
allegro_exit();
259260
return 0;
260261
}
261262
END_OF_MAIN()

src/zc/zelda.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,11 +4629,11 @@ int main(int argc, char **argv)
46294629
Z_message("ZQuest Classic new wiki: https://github.com/ZQuestClassic/ZQuestClassic/wiki\n");
46304630

46314631
skipcont = 0;
4632+
allegro_exit();
46324633
if(forceExit) //fix for the allegro at_exit() hang.
46334634
exit(0);
46344635

46354636
jit_shutdown();
4636-
allegro_exit();
46374637
return 0;
46384638
}
46394639

@@ -4767,10 +4767,10 @@ int main(int argc, char **argv)
47674767
exit_sys_pal();
47684768
if(ret!=2)
47694769
{
4770+
allegro_exit();
47704771
if(forceExit)
47714772
exit(0);
47724773

4773-
allegro_exit();
47744774
return 0;
47754775
}
47764776
}
@@ -5343,6 +5343,7 @@ int main(int argc, char **argv)
53435343
skipcont = 0;
53445344

53455345
zscript_coloured_console.kill();
5346+
allegro_exit();
53465347
if(forceExit) //fix for the allegro at_exit() hang.
53475348
exit(0);
53485349

src/zq/zquest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26718,6 +26718,7 @@ int32_t main(int32_t argc,char **argv)
2671826718
if(used_switch(argc,argv,"-q"))
2671926719
{
2672026720
Z_message("-q switch used, quitting program.\n");
26721+
allegro_exit();
2672126722
exit(0);
2672226723
}
2672326724

@@ -26885,6 +26886,7 @@ int32_t main(int32_t argc,char **argv)
2688526886

2688626887
quit_game();
2688726888

26889+
allegro_exit();
2688826890
if(ForceExit) //last resort fix to the allegro process hanging bug.
2688926891
exit(0);
2689026892

0 commit comments

Comments
 (0)