summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-01-03 12:26:02 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2018-01-04 23:04:12 +0100
commitc9b3d87eb7ef2ce99f659d7e567fc83629439142 (patch)
tree9c3632609f0711aa4f555a4de228f3030e728f0e /src/irc
parente405330e04dc344797f00c12cf8fd7f63b17e0e4 (diff)
downloadirssi-c9b3d87eb7ef2ce99f659d7e567fc83629439142.zip
Postpone server cleanup until after unref
Add a new signal, server destroyed, that is supposed to run the clean up tasks of server disconnected. This is so that some structures will stay around longer.
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-servers.c6
-rw-r--r--src/irc/flood/flood.c4
-rw-r--r--src/irc/notifylist/notifylist.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index 4eaab712..5076a688 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -425,7 +425,7 @@ static void isupport_destroy_hash(void *key, void *value)
g_free(value);
}
-static void sig_disconnected(IRC_SERVER_REC *server)
+static void sig_destroyed(IRC_SERVER_REC *server)
{
GSList *tmp;
@@ -1031,7 +1031,7 @@ void irc_servers_init(void)
cmd_tag = -1;
signal_add_first("server connected", (SIGNAL_FUNC) sig_connected);
- signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected);
+ signal_add_last("server destroyed", (SIGNAL_FUNC) sig_destroyed);
signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit);
signal_add("event 001", (SIGNAL_FUNC) event_connected);
signal_add("event 004", (SIGNAL_FUNC) event_server_info);
@@ -1058,7 +1058,7 @@ void irc_servers_deinit(void)
g_source_remove(cmd_tag);
signal_remove("server connected", (SIGNAL_FUNC) sig_connected);
- signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
+ signal_remove("server destroyed", (SIGNAL_FUNC) sig_destroyed);
signal_remove("server quit", (SIGNAL_FUNC) sig_server_quit);
signal_remove("event 001", (SIGNAL_FUNC) event_connected);
signal_remove("event 004", (SIGNAL_FUNC) event_server_info);
diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c
index 0944a6eb..b528f707 100644
--- a/src/irc/flood/flood.c
+++ b/src/irc/flood/flood.c
@@ -324,7 +324,7 @@ void irc_flood_init(void)
read_settings();
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
signal_add_first("server connected", (SIGNAL_FUNC) flood_init_server);
- signal_add("server disconnected", (SIGNAL_FUNC) flood_deinit_server);
+ signal_add("server destroyed", (SIGNAL_FUNC) flood_deinit_server);
autoignore_init();
settings_check();
@@ -344,5 +344,5 @@ void irc_flood_deinit(void)
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
signal_remove("server connected", (SIGNAL_FUNC) flood_init_server);
- signal_remove("server disconnected", (SIGNAL_FUNC) flood_deinit_server);
+ signal_remove("server destroyed", (SIGNAL_FUNC) flood_deinit_server);
}
diff --git a/src/irc/notifylist/notifylist.c b/src/irc/notifylist/notifylist.c
index 573f7a7f..4fd5ef1a 100644
--- a/src/irc/notifylist/notifylist.c
+++ b/src/irc/notifylist/notifylist.c
@@ -331,7 +331,7 @@ void irc_notifylist_init(void)
notifylist_ison_init();
notifylist_whois_init();
signal_add("server connected", (SIGNAL_FUNC) notifylist_init_server);
- signal_add("server disconnected", (SIGNAL_FUNC) notifylist_deinit_server);
+ signal_add("server destroyed", (SIGNAL_FUNC) notifylist_deinit_server);
signal_add("event quit", (SIGNAL_FUNC) event_quit);
signal_add("event privmsg", (SIGNAL_FUNC) event_privmsg);
signal_add("event join", (SIGNAL_FUNC) event_join);
@@ -349,7 +349,7 @@ void irc_notifylist_deinit(void)
notifylist_whois_deinit();
signal_remove("server connected", (SIGNAL_FUNC) notifylist_init_server);
- signal_remove("server disconnected", (SIGNAL_FUNC) notifylist_deinit_server);
+ signal_remove("server destroyed", (SIGNAL_FUNC) notifylist_deinit_server);
signal_remove("event quit", (SIGNAL_FUNC) event_quit);
signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
signal_remove("event join", (SIGNAL_FUNC) event_join);