diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-03-19 13:10:48 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-03-19 13:10:48 +0300 |
commit | 7f1a83e606d0ec766ef3c0ca4830ca47cc1fe867 (patch) | |
tree | 8480956cec3a029bdab11fb0780b9935a255b703 | |
parent | 1c7032c49d680a8b34b0415c2e4808f27494c9a4 (diff) | |
download | sciteco-7f1a83e606d0ec766ef3c0ca4830ca47cc1fe867.tar.gz |
fixup cddc9bf83eb5cd2c69626b31ae7373342523b626: errors must be printed before cleaning up the interface
This fixes crashes on Gtk.
-rw-r--r-- | src/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -553,6 +553,9 @@ main(int argc, char **argv) goto cleanup; cleanup: + if (error != NULL) + teco_error_display_full(error); + #ifndef NDEBUG teco_ring_cleanup(); teco_qreg_table_clear(&local_qregs); @@ -562,10 +565,5 @@ cleanup: #endif teco_interface_cleanup(); - if (error != NULL) { - teco_error_display_full(error); - return EXIT_FAILURE; - } - - return 0; + return error ? EXIT_FAILURE : EXIT_SUCCESS; } |