Skip to content

Commit 5e53af6

Browse files
committed
Fix race condition
1 parent 8c7448e commit 5e53af6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu

+2
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,10 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter&
584584
#ifdef FLAMEGPU_VISUALISATION
585585
if (has_changed) {
586586
if (auto vis = visualisation.lock()) {
587+
vis->visualiser->lockDynamicLinesMutex();
587588
vis->rebuildEnvGraph(graph_description.name);
588589
vis->visualiser->updateDynamicLine(std::string("graph_") + graph_description.name);
590+
vis->visualiser->releaseDynamicLinesMutex();
589591
}
590592
}
591593
#endif

0 commit comments

Comments
 (0)