Skip to content

Commit

Permalink
Fix client crash on when con::PeerNotFoundException is thrown (#11286)
Browse files Browse the repository at this point in the history
  • Loading branch information
savilli committed May 24, 2021
1 parent 93f43c8 commit 673c29f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/client/clientlauncher.cpp
Expand Up @@ -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?)");
Expand All @@ -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()) {
Expand Down

0 comments on commit 673c29f

Please sign in to comment.