From 2556edb8d3ef9660f8ee2a85b21b7452ed4071cd Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 2 Jul 2021 18:15:30 +0200 Subject: [PATCH] Fix crash wen using Anim Graph debugging with lots of animated models simulated at once in async --- Source/Engine/Animations/Animations.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Engine/Animations/Animations.cpp b/Source/Engine/Animations/Animations.cpp index efff52998..033659948 100644 --- a/Source/Engine/Animations/Animations.cpp +++ b/Source/Engine/Animations/Animations.cpp @@ -95,6 +95,12 @@ void AnimationsSystem::Execute(TaskGraph* graph) Time = tickData.Time.GetTotalSeconds(); UnscaledTime = tickData.UnscaledTime.GetTotalSeconds(); +#if USE_EDITOR + // If debug flow is registered, then warm it up (eg. static cached method inside DebugFlow_ManagedWrapper) so it doesn;'t crash on highly multi-threaded code + if (Animations::DebugFlow.IsBinded()) + Animations::DebugFlow(nullptr, nullptr, 0, 0); +#endif + // Schedule work to update all animated models in async Function job; job.Bind(this);