summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-18 10:55:14 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-18 10:55:14 +0000
commit0abb62a4719dac1e59f5ecf97540c3bb24af9bb2 (patch)
treeed41c0965cf40eb7dcefa0432670cd114ef05d59 /src
parent1a80491f818468008a376e5cb7097875181cadb8 (diff)
downloadirssi-0abb62a4719dac1e59f5ecf97540c3bb24af9bb2.zip
When destroying data used from server in "server disconnected" signal, set
the data to NULL as well, the server record is still used after the signal is finished (the channels it uses are destroyed, which may trigger scripts etc.) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2046 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/channels-query.c2
-rw-r--r--src/irc/core/ctcp.c1
-rw-r--r--src/irc/core/irc-servers.c9
-rw-r--r--src/irc/core/netsplit.c1
-rw-r--r--src/irc/core/servers-redirect.c7
5 files changed, 14 insertions, 6 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c
index 42d98f84..aa4130ed 100644
--- a/src/irc/core/channels-query.c
+++ b/src/irc/core/channels-query.c
@@ -97,6 +97,8 @@ static void sig_disconnected(IRC_SERVER_REC *server)
g_slist_free(rec->queries[n]);
g_slist_free(rec->current_queries);
g_free(rec);
+
+ server->chanqueries = NULL;
}
/* Add channel to query list */
diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c
index b3d56fb6..5231f53d 100644
--- a/src/irc/core/ctcp.c
+++ b/src/irc/core/ctcp.c
@@ -216,6 +216,7 @@ static void sig_disconnected(IRC_SERVER_REC *server)
return;
g_slist_free(server->ctcpqueue);
+ server->ctcpqueue = NULL;
}
void ctcp_init(void)
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index 2d4dcbcc..30f99684 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -265,11 +265,12 @@ static void sig_disconnected(IRC_SERVER_REC *server)
server_redirect_destroy(tmp->next->data);
}
g_slist_free(server->cmdqueue);
+ server->cmdqueue = NULL;
- g_free_not_null(server->real_address);
- g_free_not_null(server->usermode);
- g_free_not_null(server->userhost);
- g_free_not_null(server->last_invite);
+ g_free_and_null(server->real_address);
+ g_free_and_null(server->usermode);
+ g_free_and_null(server->userhost);
+ g_free_and_null(server->last_invite);
}
static void sig_server_quit(IRC_SERVER_REC *server, const char *msg)
diff --git a/src/irc/core/netsplit.c b/src/irc/core/netsplit.c
index 85df67fd..594f5f8e 100644
--- a/src/irc/core/netsplit.c
+++ b/src/irc/core/netsplit.c
@@ -357,6 +357,7 @@ static void sig_disconnected(IRC_SERVER_REC *server)
g_hash_table_foreach(server->splits,
(GHFunc) netsplit_destroy_hash, server);
g_hash_table_destroy(server->splits);
+ server->splits = NULL;
}
static int split_server_check(void *key, NETSPLIT_REC *rec,
diff --git a/src/irc/core/servers-redirect.c b/src/irc/core/servers-redirect.c
index 495423bc..39c5650e 100644
--- a/src/irc/core/servers-redirect.c
+++ b/src/irc/core/servers-redirect.c
@@ -522,9 +522,12 @@ static void sig_disconnected(IRC_SERVER_REC *server)
g_slist_foreach(server->redirects,
(GFunc) server_redirect_destroy, NULL);
g_slist_free(server->redirects);
+ server->redirects = NULL;
- if (server->redirect_next != NULL)
- server_redirect_destroy(server->redirect_next);
+ if (server->redirect_next != NULL) {
+ server_redirect_destroy(server->redirect_next);
+ server->redirect_next = NULL;
+ }
}
static void cmd_redirect_destroy(char *key, REDIRECT_CMD_REC *cmd)