summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
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);
}