mirror of
https://github.com/overte-org/overte.git
synced 2025-06-16 13:20:01 +02:00
Merge pull request #10910 from Atlante45/fix/audio-mixer-crash
Fix Audio Mixer crash
This commit is contained in:
commit
ab6f615f96
1 changed files with 6 additions and 2 deletions
|
@ -197,8 +197,12 @@ public:
|
||||||
*lockWaitOut = (endLock - start);
|
*lockWaitOut = (endLock - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<SharedNodePointer> nodes(_nodeHash.size());
|
// Size of _nodeHash could change at any time,
|
||||||
std::transform(_nodeHash.cbegin(), _nodeHash.cend(), nodes.begin(), [](const NodeHash::value_type& it) {
|
// so reserve enough memory for the current size
|
||||||
|
// and then back insert all the nodes found
|
||||||
|
std::vector<SharedNodePointer> nodes;
|
||||||
|
nodes.reserve(_nodeHash.size());
|
||||||
|
std::transform(_nodeHash.cbegin(), _nodeHash.cend(), std::back_inserter(nodes), [&](const NodeHash::value_type& it) {
|
||||||
return it.second;
|
return it.second;
|
||||||
});
|
});
|
||||||
auto endTransform = usecTimestampNow();
|
auto endTransform = usecTimestampNow();
|
||||||
|
|
Loading…
Reference in a new issue