diff options
-rw-r--r-- | src/core/commands.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/commands.c b/src/core/commands.c index 928d73a0..9d7cfe2d 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -863,7 +863,11 @@ static void parse_command(const char *command, int expand_aliases, signal_emit_id(signal_default_command, 3, command, server, item); } - if (server != NULL) server_unref(server); + if (server != NULL) { + if (server->connection_lost) + server_disconnect(server); + server_unref(server); + } current_command = oldcmd; g_free(cmd); |