mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-23 21:29:13 +02:00
Added workaround to prevent multithreaded access to bonus system in RMG
This commit is contained in:
parent
ea439ad175
commit
f83a004b54
@ -273,6 +273,10 @@ CBonusSystemNode::~CBonusSystemNode()
|
||||
|
||||
void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
|
||||
{
|
||||
// quick workaround to prevent multithreaded access to bonus system in RMG
|
||||
static boost::mutex attachMutex;
|
||||
boost::lock_guard<boost::mutex> lock(attachMutex);
|
||||
|
||||
assert(!vstd::contains(parents, &parent));
|
||||
parents.push_back(&parent);
|
||||
|
||||
@ -646,4 +650,4 @@ int64_t CBonusSystemNode::getTreeVersion() const
|
||||
return treeChanged;
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user