mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 19:43:45 +01:00
Lock mutex when accessing m_env in Server::~Server
This commit is contained in:
parent
853a78681e
commit
080002f8ed
@ -1140,17 +1140,21 @@ Server::~Server()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
{
|
||||||
Save players
|
JMutexAutoLock envlock(m_env_mutex);
|
||||||
*/
|
|
||||||
dstream<<"Server: Saving players"<<std::endl;
|
|
||||||
m_env.serializePlayers(m_mapsavedir);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Save environment metadata
|
Save players
|
||||||
*/
|
*/
|
||||||
dstream<<"Server: Saving environment metadata"<<std::endl;
|
dstream<<"Server: Saving players"<<std::endl;
|
||||||
m_env.saveMeta(m_mapsavedir);
|
m_env.serializePlayers(m_mapsavedir);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Save environment metadata
|
||||||
|
*/
|
||||||
|
dstream<<"Server: Saving environment metadata"<<std::endl;
|
||||||
|
m_env.saveMeta(m_mapsavedir);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Stop threads
|
Stop threads
|
||||||
@ -1202,6 +1206,8 @@ void Server::stop()
|
|||||||
{
|
{
|
||||||
DSTACK(__FUNCTION_NAME);
|
DSTACK(__FUNCTION_NAME);
|
||||||
|
|
||||||
|
dout_server<<"Server: Stopping and waiting threads"<<std::endl;
|
||||||
|
|
||||||
// Stop threads (set run=false first so both start stopping)
|
// Stop threads (set run=false first so both start stopping)
|
||||||
m_thread.setRun(false);
|
m_thread.setRun(false);
|
||||||
m_emergethread.setRun(false);
|
m_emergethread.setRun(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user