1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Channels and ircnets got lost after /RELOAD and /SAVE

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@534 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-24 23:21:11 +00:00 committed by cras
parent 0b2448b97f
commit 7f104ed15c
2 changed files with 16 additions and 6 deletions

View File

@ -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);

View File

@ -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);