summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-03 18:32:46 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-03 18:32:46 +0000
commite8957938ea78c5089f9088b18db7910091d75ca2 (patch)
tree460d9753fc821bb78240a71ad50bced7c80293a5 /src/core
parentaa544dec32d57c8f6a33e2c27d711cff2e8c0f88 (diff)
downloadirssi-e8957938ea78c5089f9088b18db7910091d75ca2.zip
A bit more safer now to use /EVAL with a command that disconnects from
server.. Also added a FIXME: window item would need reference counting as well, eg. "/EVAL win close;say hello" wouldn't work now.. But that's probably job for the rewrite irssi. don't go use things like that :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2381 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/special-vars.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index 36d0743c..c695a0a7 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -582,8 +582,19 @@ void eval_special_string(const char *cmd, const char *data,
ret = g_strconcat(old, " ", data, NULL);
g_free(old);
}
+
+ server_ref(server);
signal_emit("send command", 3, ret, server, item);
+ if (!server_unref(server)) {
+ /* the server was destroyed */
+ server = NULL;
+ item = NULL;
+ }
+
+ /* FIXME: window item would need reference counting as well,
+ eg. "/EVAL win close;say hello" wouldn't work now.. */
+
g_free(ret);
commands = g_slist_remove(commands, commands->data);
}