From 75b64ad41b22ef716c66aec94beda2f40c638740 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 31 Jan 2023 04:07:42 +0200 Subject: [PATCH 36/37] Fix Qt-client crash after handling "-- --help" command line See osdn #46660 Signed-off-by: Marko Lindqvist --- client/client_main.c | 4 +++- client/tilespec.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/client_main.c b/client/client_main.c index cdb2665ded..0ed4f5a121 100644 --- a/client/client_main.c +++ b/client/client_main.c @@ -730,7 +730,9 @@ void fc__noreturn client_exit(int return_value) if (unscaled_tileset != NULL) { tileset_free(unscaled_tileset); } - tileset_free(tileset); + if (tileset != NULL) { + tileset_free(tileset); + } ui_exit(); diff --git a/client/tilespec.c b/client/tilespec.c index 91493cd67d..b59a8428ec 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -556,7 +556,7 @@ struct tileset { char** preferred_themes; }; -struct tileset *tileset; +struct tileset *tileset = NULL; struct tileset *unscaled_tileset = NULL; int focus_unit_state = 0; -- 2.39.0