summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc/core/channels-setup.c11
-rw-r--r--src/irc/core/ircnet-setup.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/src/irc/core/channels-setup.c b/src/irc/core/channels-setup.c
index 2b8aef28..3d40ad0b 100644
--- a/src/irc/core/channels-setup.c
+++ b/src/irc/core/channels-setup.c
@@ -73,11 +73,10 @@ void channels_setup_create(SETUP_CHANNEL_REC *channel)
channel_config_add(channel);
}
-void channels_setup_destroy(SETUP_CHANNEL_REC *channel)
+static void channels_setup_destroy_rec(SETUP_CHANNEL_REC *channel)
{
g_return_if_fail(channel != NULL);
- channel_config_remove(channel);
setupchannels = g_slist_remove(setupchannels, channel);
g_free(channel->name);
@@ -90,6 +89,12 @@ void channels_setup_destroy(SETUP_CHANNEL_REC *channel)
g_free(channel);
}
+void channels_setup_destroy(SETUP_CHANNEL_REC *channel)
+{
+ channel_config_remove(channel);
+ channels_setup_destroy_rec(channel);
+}
+
SETUP_CHANNEL_REC *channels_setup_find(const char *channel, const char *ircnet)
{
GSList *tmp;
@@ -209,7 +214,7 @@ static void channels_read_config(void)
GSList *tmp;
while (setupchannels != NULL)
- channels_setup_destroy(setupchannels->data);
+ channels_setup_destroy_rec(setupchannels->data);
/* Read channels */
node = iconfig_node_traverse("channels", FALSE);
diff --git a/src/irc/core/ircnet-setup.c b/src/irc/core/ircnet-setup.c
index b3946e6a..2c5eeb82 100644
--- a/src/irc/core/ircnet-setup.c
+++ b/src/irc/core/ircnet-setup.c
@@ -76,9 +76,8 @@ void ircnet_create(IRCNET_REC *ircnet)
ircnet_config_add(ircnet);
}
-void ircnet_destroy(IRCNET_REC *ircnet)
+static void ircnet_destroy_rec(IRCNET_REC *ircnet)
{
- ircnet_config_remove(ircnet);
ircnets = g_slist_remove(ircnets, ircnet);
g_free(ircnet->name);
@@ -90,6 +89,12 @@ void ircnet_destroy(IRCNET_REC *ircnet)
g_free(ircnet);
}
+void ircnet_destroy(IRCNET_REC *ircnet)
+{
+ ircnet_config_remove(ircnet);
+ ircnet_destroy_rec(ircnet);
+}
+
/* Find the irc network by name */
IRCNET_REC *ircnet_find(const char *name)
{
@@ -141,7 +146,7 @@ static void read_ircnets(void)
GSList *tmp;
while (ircnets != NULL)
- ircnet_destroy(ircnets->data);
+ ircnet_destroy_rec(ircnets->data);
/* read ircnets */
node = iconfig_node_traverse("ircnets", FALSE);