mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Fix for potential crash due to DebugDraw data race.
This commit is contained in:
parent
b0ad9a8110
commit
1b8a624edb
1 changed files with 4 additions and 3 deletions
|
@ -346,7 +346,9 @@ void AnimDebugDraw::update() {
|
|||
numVerts += (int)markerMap.size() * VERTICES_PER_BONE;
|
||||
auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
|
||||
numVerts += (int)myAvatarMarkerMap.size() * VERTICES_PER_BONE;
|
||||
numVerts += (int)DebugDraw::getInstance().getRays().size() * VERTICES_PER_RAY;
|
||||
auto rays = DebugDraw::getInstance().getRays();
|
||||
DebugDraw::getInstance().clearRays();
|
||||
numVerts += (int)rays.size() * VERTICES_PER_RAY;
|
||||
|
||||
// allocate verts!
|
||||
std::vector<AnimDebugDrawData::Vertex> vertices;
|
||||
|
@ -398,10 +400,9 @@ void AnimDebugDraw::update() {
|
|||
}
|
||||
|
||||
// draw rays from shared DebugDraw singleton
|
||||
for (auto& iter : DebugDraw::getInstance().getRays()) {
|
||||
for (auto& iter : rays) {
|
||||
addLine(std::get<0>(iter), std::get<1>(iter), std::get<2>(iter), v);
|
||||
}
|
||||
DebugDraw::getInstance().clearRays();
|
||||
|
||||
data._vertexBuffer->resize(sizeof(AnimDebugDrawData::Vertex) * numVerts);
|
||||
data._vertexBuffer->setSubData<AnimDebugDrawData::Vertex>(0, vertices);
|
||||
|
|
Loading…
Reference in a new issue