summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-28 20:36:42 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-28 20:36:42 +0000
commit6871f558b567251d9789d1216f05f1c048682479 (patch)
tree234c94b75008e35b0a9338d7a1ae9d1f344a5c0d /src
parent700df914298269a404acd5545637c592c8e191fa (diff)
downloadirssi-6871f558b567251d9789d1216f05f1c048682479.zip
when destroying channel, it really should be removed also from
server->channels list. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2829 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/channels.c5
-rw-r--r--src/core/servers.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/channels.c b/src/core/channels.c
index 5dd90c2e..9a92b896 100644
--- a/src/core/channels.c
+++ b/src/core/channels.c
@@ -77,8 +77,9 @@ void channel_destroy(CHANNEL_REC *channel)
channel->destroying = TRUE;
channels = g_slist_remove(channels, channel);
- if (!channel->server->disconnected)
- channel->server->channels = g_slist_remove(channel->server->channels, channel);
+ channel->server->channels =
+ g_slist_remove(channel->server->channels, channel);
+
signal_emit("channel destroyed", 1, channel);
MODULE_DATA_DEINIT(channel);
diff --git a/src/core/servers.c b/src/core/servers.c
index 4828750b..4f5b0402 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -361,15 +361,16 @@ int server_start_connect(SERVER_REC *server)
static int server_remove_channels(SERVER_REC *server)
{
- GSList *tmp;
+ GSList *tmp, *next;
int found;
g_return_val_if_fail(server != NULL, FALSE);
found = FALSE;
- for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
+ for (tmp = server->channels; tmp != NULL; tmp = next) {
CHANNEL_REC *channel = tmp->data;
+ next = tmp->next;
channel_destroy(channel);
found = TRUE;
}