diff options
| author | vaxerski <vaxry@vaxry.net> | 2025-01-10 21:55:19 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2025-01-10 21:55:19 +0100 |
| commit | cef09fbfe6624d2133d81be863bd48bcfc5939d3 (patch) | |
| tree | 0b5c3ffa6556b484348ce23a1425070bb47ee030 /src/managers/AnimationManager.cpp | |
| parent | a8b568c6c451cdce3c8d40ae010247be3f25728b (diff) | |
animation: avoid crashes in ::tick() on mutations
mutating the active variables is valid during a tick, we can't let it crash
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index f0f6a980..ea74ffd2 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -215,7 +215,11 @@ void CHyprAnimationManager::tick() { lastTick = std::chrono::high_resolution_clock::now(); static auto PANIMENABLED = CConfigValue<Hyprlang::INT>("animations:enabled"); - for (auto const& pav : m_vActiveAnimatedVariables) { + + // We need to do this because it's perfectly valid to add/change a var during this (via callbacks) + // FIXME: instead of doing this, make a fn to defer adding until tick is done and not in progress anymore. + const auto PAVS = m_vActiveAnimatedVariables; + for (auto const& pav : PAVS) { const auto PAV = pav.lock(); if (!PAV) continue; |
