From bcecb2f8772fa28aeafc476b98fbdcb09521f73e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 29 Apr 2018 22:58:37 +1000 Subject: [PATCH] Fix crash on quitting --- src/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 196441c8..d90dffed 100644 --- a/src/main.cc +++ b/src/main.cc @@ -686,9 +686,12 @@ int run_server(StringView session, StringView server_init, client_manager.clear_window_trash(); buffer_manager.clear_buffer_trash(); - if (local_client and not local_client->is_ui_ok()) + if (local_client and not contains(client_manager, local_client)) + local_client = nullptr; + else if (local_client and not local_client->is_ui_ok()) { ClientManager::instance().remove_client(*local_client, false, -1); + local_client = nullptr; if (not client_manager.empty() and fork_server_to_background()) return 0; }