mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
Run scriptapi_on_shutdown() thread-safely and remove some old crap
This commit is contained in:
parent
6c8fa83ecd
commit
8a93581c8a
@ -1113,10 +1113,15 @@ Server::~Server()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
JMutexAutoLock envlock(m_env_mutex);
|
||||||
|
JMutexAutoLock conlock(m_con_mutex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Execute script shutdown hooks
|
Execute script shutdown hooks
|
||||||
*/
|
*/
|
||||||
scriptapi_on_shutdown(m_lua);
|
scriptapi_on_shutdown(m_lua);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
JMutexAutoLock envlock(m_env_mutex);
|
JMutexAutoLock envlock(m_env_mutex);
|
||||||
@ -1149,14 +1154,6 @@ Server::~Server()
|
|||||||
i = m_clients.getIterator();
|
i = m_clients.getIterator();
|
||||||
i.atEnd() == false; i++)
|
i.atEnd() == false; i++)
|
||||||
{
|
{
|
||||||
/*// Delete player
|
|
||||||
// NOTE: These are removed by env destructor
|
|
||||||
{
|
|
||||||
u16 peer_id = i.getNode()->getKey();
|
|
||||||
JMutexAutoLock envlock(m_env_mutex);
|
|
||||||
m_env->removePlayer(peer_id);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Delete client
|
// Delete client
|
||||||
delete i.getNode()->getValue();
|
delete i.getNode()->getValue();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user