Lock mutex when accessing m_env in Server::~Server
parent
853a78681e
commit
080002f8ed
|
@ -1140,6 +1140,9 @@ Server::~Server()
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
JMutexAutoLock envlock(m_env_mutex);
|
||||
|
||||
/*
|
||||
Save players
|
||||
*/
|
||||
|
@ -1151,6 +1154,7 @@ Server::~Server()
|
|||
*/
|
||||
dstream<<"Server: Saving environment metadata"<<std::endl;
|
||||
m_env.saveMeta(m_mapsavedir);
|
||||
}
|
||||
|
||||
/*
|
||||
Stop threads
|
||||
|
@ -1202,6 +1206,8 @@ void Server::stop()
|
|||
{
|
||||
DSTACK(__FUNCTION_NAME);
|
||||
|
||||
dout_server<<"Server: Stopping and waiting threads"<<std::endl;
|
||||
|
||||
// Stop threads (set run=false first so both start stopping)
|
||||
m_thread.setRun(false);
|
||||
m_emergethread.setRun(false);
|
||||
|
|
Loading…
Reference in New Issue