From 6d44620b4a0bcf52649dce18f3b42ecb39127ffc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 11 Jan 2002 05:47:52 +0000 Subject: When commands were being parsed, the currectly active server should have been referenced, but the code was accidentally in subcommand parser not in the main one.. Also, the connection_lost wasn't checked after parsing the command and might have caused a glib error. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2307 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/commands.c b/src/core/commands.c index 7893b1c1..928d73a0 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -313,7 +313,6 @@ void command_runsub(const char *cmd, const char *data, subcmd = g_strconcat("command ", newcmd, NULL); g_strdown(subcmd); - if (server != NULL) server_ref(server); if (!signal_emit(subcmd, 3, args, server, item)) { defcmd = g_strdup_printf("default command %s", cmd); if (!signal_emit(defcmd, 3, data, server, item)) { @@ -322,7 +321,6 @@ void command_runsub(const char *cmd, const char *data, } g_free(defcmd); } - if (server != NULL) server_unref(server); g_free(subcmd); g_free(orig); @@ -860,10 +858,12 @@ static void parse_command(const char *command, int expand_aliases, oldcmd = current_command; current_command = cmd+8; - if (!signal_emit(cmd, 3, args, server, item)) { + if (server != NULL) server_ref(server); + if (!signal_emit(cmd, 3, args, server, item)) { signal_emit_id(signal_default_command, 3, command, server, item); } + if (server != NULL) server_unref(server); current_command = oldcmd; g_free(cmd); -- cgit v1.2.3