]> jfr.im git - irc/irssi/irssi.git/commitdiff
Merge pull request #59 from ailin-nemui/ilog-domain
authorailin-nemui <redacted>
Sun, 6 Feb 2022 00:11:41 +0000 (01:11 +0100)
committerAilin Nemui <redacted>
Sun, 29 May 2022 16:59:38 +0000 (18:59 +0200)
fix crash when accessing settings during shutdown

(cherry picked from commit cc411a1be009b9c6eac9811abeff10d8bab0efc8)

src/core/settings.c
src/fe-common/core/fe-common-core.c

index 28f953ba815598b758eedaf2c6543a8595042adc..1e7ef2ee62c38fc137bd582c906afe25a57ee73e 100644 (file)
@@ -928,6 +928,7 @@ void settings_deinit(void)
 
        g_hash_table_foreach(settings, (GHFunc) settings_hash_free, NULL);
        g_hash_table_destroy(settings);
+       settings = NULL;
 
        if (mainconfig != NULL) config_close(mainconfig);
 }
index 1fcd5df1171d9890c8eb6b966047df1479a40c6c..6a92971996493398c8882b53d1e679a897b51ec8 100644 (file)
@@ -57,6 +57,7 @@ static int autocon_port;
 static int no_autoconnect;
 static char *cmdline_nick;
 static char *cmdline_hostname;
+GLogFunc logger_old;
 
 void fe_core_log_init(void);
 void fe_core_log_deinit(void);
@@ -252,6 +253,8 @@ void fe_common_core_deinit(void)
         signal_remove("server destroyed", (SIGNAL_FUNC) sig_destroyed);
         signal_remove("channel created", (SIGNAL_FUNC) sig_channel_created);
         signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
+
+       g_log_set_default_handler(logger_old, NULL);
 }
 
 void i_log_func(const char *log_domain, GLogLevelFlags log_level, const char *message)
@@ -458,7 +461,7 @@ void fe_common_core_finish_init(void)
        signal_add_first("setup changed", (SIGNAL_FUNC) sig_setup_changed);
 
         /* _after_ windows are created.. */
-       g_log_set_default_handler((GLogFunc) i_log_func, NULL);
+       logger_old = g_log_set_default_handler((GLogFunc) i_log_func, NULL);
 
        if (setup_changed)
                 signal_emit("setup changed", 0);