mirror of
https://github.com/minetest/minetest.git
synced 2025-01-08 14:27:31 +01:00
Fix some Game members not being freed after some startup errors (#14561)
This commit is contained in:
parent
f572266f19
commit
00774bc28b
@ -215,8 +215,9 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
|
|||||||
L" " + utf8_to_wide(g_version_hash) +
|
L" " + utf8_to_wide(g_version_hash) +
|
||||||
L" [" + wstrgettext("Main Menu") + L"]").c_str());
|
L" [" + wstrgettext("Main Menu") + L"]").c_str());
|
||||||
|
|
||||||
try { // This is used for catching disconnects
|
#ifdef NDEBUG
|
||||||
|
try {
|
||||||
|
#endif
|
||||||
m_rendering_engine->get_gui_env()->clear();
|
m_rendering_engine->get_gui_env()->clear();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -267,14 +268,8 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
|
|||||||
chat_backend,
|
chat_backend,
|
||||||
&reconnect_requested
|
&reconnect_requested
|
||||||
);
|
);
|
||||||
} //try
|
|
||||||
catch (con::PeerNotFoundException &e) {
|
|
||||||
error_message = gettext("Connection error (timed out?)");
|
|
||||||
errorstream << error_message << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
error_message = "Some exception: ";
|
error_message = "Some exception: ";
|
||||||
error_message.append(debug_describe_exc(e));
|
error_message.append(debug_describe_exc(e));
|
||||||
errorstream << error_message << std::endl;
|
errorstream << error_message << std::endl;
|
||||||
|
@ -1057,6 +1057,12 @@ Game::Game() :
|
|||||||
|
|
||||||
Game::~Game()
|
Game::~Game()
|
||||||
{
|
{
|
||||||
|
delete client;
|
||||||
|
delete soundmaker;
|
||||||
|
sound_manager.reset();
|
||||||
|
|
||||||
|
delete server;
|
||||||
|
|
||||||
delete hud;
|
delete hud;
|
||||||
delete camera;
|
delete camera;
|
||||||
delete quicktune;
|
delete quicktune;
|
||||||
@ -1311,11 +1317,14 @@ void Game::shutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete client;
|
delete client;
|
||||||
|
client = nullptr;
|
||||||
delete soundmaker;
|
delete soundmaker;
|
||||||
|
soundmaker = nullptr;
|
||||||
sound_manager.reset();
|
sound_manager.reset();
|
||||||
|
|
||||||
auto stop_thread = runInThread([=] {
|
auto stop_thread = runInThread([=] {
|
||||||
delete server;
|
delete server;
|
||||||
|
server = nullptr;
|
||||||
}, "ServerStop");
|
}, "ServerStop");
|
||||||
|
|
||||||
FpsControl fps_control;
|
FpsControl fps_control;
|
||||||
@ -4611,6 +4620,10 @@ void the_game(bool *kill,
|
|||||||
error_message = std::string("ModError: ") + e.what() +
|
error_message = std::string("ModError: ") + e.what() +
|
||||||
strgettext("\nCheck debug.txt for details.");
|
strgettext("\nCheck debug.txt for details.");
|
||||||
errorstream << error_message << std::endl;
|
errorstream << error_message << std::endl;
|
||||||
|
} catch (con::PeerNotFoundException &e) {
|
||||||
|
error_message = gettext("Connection error (timed out?)");
|
||||||
|
errorstream << error_message << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.shutdown();
|
game.shutdown();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user