1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Sort out server destruction order

fixes #14421
This commit is contained in:
sfan5 2024-03-01 20:02:58 +01:00
parent 4d24537590
commit ef0009aea7
4 changed files with 40 additions and 31 deletions

View file

@ -534,18 +534,18 @@ void ServerEnvironment::init()
}
}
ServerEnvironment::~ServerEnvironment()
void ServerEnvironment::deactivateBlocksAndObjects()
{
// Clear active block list.
// This makes the next one delete all active objects.
m_active_blocks.clear();
try {
// Convert all objects to static and delete the active objects
deactivateFarObjects(true);
} catch (ModError &e) {
m_server->addShutdownError(e);
}
deactivateFarObjects(true);
}
ServerEnvironment::~ServerEnvironment()
{
assert(m_active_blocks.size() == 0); // deactivateBlocksAndObjects does this
// Drop/delete map
if (m_map)