summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-22 21:04:39 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-22 21:04:39 +0000
commit4c4f7ec042794f1ce1b4bcc1c092507d77db0926 (patch)
treedf82705f82c63d19f24278443ebe36c671ba6720 /src/core
parent92eaf0dc9a198d92115d306554b3ddbfe18b7c97 (diff)
downloadirssi-4c4f7ec042794f1ce1b4bcc1c092507d77db0926.zip
last commit was only partial :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2340 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/servers.c11
-rw-r--r--src/core/servers.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/core/servers.c b/src/core/servers.c
index d31f64ad..b455f553 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -347,6 +347,7 @@ void server_disconnect(SERVER_REC *server)
servers = g_slist_remove(servers, server);
+ server->disconnected = TRUE;
signal_emit("server disconnected", 1, server);
/* close all channels */
@@ -370,7 +371,6 @@ void server_disconnect(SERVER_REC *server)
server->readtag = -1;
}
- server->disconnected = TRUE;
server_unref(server);
}
@@ -381,17 +381,17 @@ void server_ref(SERVER_REC *server)
server->refcount++;
}
-void server_unref(SERVER_REC *server)
+int server_unref(SERVER_REC *server)
{
- g_return_if_fail(IS_SERVER(server));
+ g_return_val_if_fail(IS_SERVER(server), FALSE);
if (--server->refcount > 0)
- return;
+ return TRUE;
if (g_slist_find(servers, server) != NULL) {
g_warning("Non-referenced server wasn't disconnected");
server_disconnect(server);
- return;
+ return TRUE;
}
MODULE_DATA_DEINIT(server);
@@ -403,6 +403,7 @@ void server_unref(SERVER_REC *server)
g_free(server->nick);
g_free(server->tag);
g_free(server);
+ return FALSE;
}
SERVER_REC *server_find_tag(const char *tag)
diff --git a/src/core/servers.h b/src/core/servers.h
index ddeb2494..05ebc55e 100644
--- a/src/core/servers.h
+++ b/src/core/servers.h
@@ -40,7 +40,7 @@ void servers_deinit(void);
void server_disconnect(SERVER_REC *server);
void server_ref(SERVER_REC *server);
-void server_unref(SERVER_REC *server);
+int server_unref(SERVER_REC *server);
SERVER_REC *server_find_tag(const char *tag);
SERVER_REC *server_find_chatnet(const char *chatnet);