]> git.lizzy.rs Git - minetest.git/commitdiff
Fix client crash on when con::PeerNotFoundException is thrown (#11286)
authorsavilli <78875209+savilli@users.noreply.github.com>
Mon, 24 May 2021 17:40:35 +0000 (19:40 +0200)
committerGitHub <noreply@github.com>
Mon, 24 May 2021 17:40:35 +0000 (19:40 +0200)
src/client/clientlauncher.cpp

index 6db5f2e70d59ace7201564297178f30b324e9efb..dbf1d1cd1e5fdd5846e62c164f743236aa463c4f 100644 (file)
@@ -277,14 +277,6 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
                                chat_backend,
                                &reconnect_requested
                        );
-                       m_rendering_engine->get_scene_manager()->clear();
-
-#ifdef HAVE_TOUCHSCREENGUI
-                       delete g_touchscreengui;
-                       g_touchscreengui = NULL;
-                       receiver->m_touchscreengui = NULL;
-#endif
-
                } //try
                catch (con::PeerNotFoundException &e) {
                        error_message = gettext("Connection error (timed out?)");
@@ -300,6 +292,14 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
                }
 #endif
 
+               m_rendering_engine->get_scene_manager()->clear();
+
+#ifdef HAVE_TOUCHSCREENGUI
+               delete g_touchscreengui;
+               g_touchscreengui = NULL;
+               receiver->m_touchscreengui = NULL;
+#endif
+
                // If no main menu, show error and exit
                if (skip_main_menu) {
                        if (!error_message.empty()) {