mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Player: Fix a deadlock triggered by previous commit 0e5e49736c
This commit is contained in:
parent
0e5e49736c
commit
0ae75f2a4e
2 changed files with 3 additions and 2 deletions
|
@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "player.h"
|
||||
|
||||
#include <fstream>
|
||||
#include "jthread/jmutexautolock.h"
|
||||
#include "util/numeric.h"
|
||||
#include "hud.h"
|
||||
#include "constants.h"
|
||||
|
@ -241,6 +242,7 @@ void Player::deSerialize(std::istream &is, std::string playername)
|
|||
u32 Player::addHud(HudElement *toadd)
|
||||
{
|
||||
JMutexAutoLock lock(m_mutex);
|
||||
|
||||
u32 id = getFreeHudID();
|
||||
|
||||
if (id < hud.size())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue