From c3429fa50e2493aa8823bcd672e1dedb1c425337 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 25 Nov 2001 17:03:00 +0000 Subject: [PATCH] /UPGRADE: when trying to restore connection to server of which chat protocol is unknown, close the specified handle. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2148 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/session.c b/src/core/session.c index c2a6d77a..1a79e0e8 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -184,7 +184,7 @@ static void session_save_server(SERVER_REC *server, CONFIG_REC *config, signal_emit("session save server", 3, server, config, node); /* fake the server disconnection */ - g_io_channel_unref(net_sendbuffer_handle(server->handle)); + g_io_channel_unref(net_sendbuffer_handle(server->handle)); net_sendbuffer_destroy(server->handle, FALSE); server->handle = NULL; @@ -257,8 +257,10 @@ static void session_restore_server(CONFIG_NODE *node) return; proto = chat_protocol_find(chat_type); - if (proto == NULL || proto->not_initialized) + if (proto == NULL || proto->not_initialized) { + if (handle < 0) close(handle); return; + } conn = server_create_conn(proto->id, address, port, chatnet, password, nick);