diff --git a/src/core/AnimatedVariable.hpp b/src/core/AnimatedVariable.hpp index 20dd844..3aeda09 100644 --- a/src/core/AnimatedVariable.hpp +++ b/src/core/AnimatedVariable.hpp @@ -63,7 +63,7 @@ namespace Hyprtoolkit { using CAnimatedVariable = Hyprutils::Animation::CGenericAnimatedVariable; template - using PHLANIMVAR = SP>; + using PHLANIMVAR = UP>; template using PHLANIMVARREF = WP>; diff --git a/src/core/AnimationManager.cpp b/src/core/AnimationManager.cpp index 34132b6..fc7b72b 100644 --- a/src/core/AnimationManager.cpp +++ b/src/core/AnimationManager.cpp @@ -86,8 +86,7 @@ static void updateColorVariable(CAnimatedVariable& av, const float P // } void CHTAnimationManager::tick() { - for (size_t i = 0; i < m_vActiveAnimatedVariables.size(); i++) { - const auto PAV = m_vActiveAnimatedVariables[i].lock(); + for (const auto& PAV : m_vActiveAnimatedVariables) { if (!PAV || !PAV->ok()) continue; diff --git a/src/core/AnimationManager.hpp b/src/core/AnimationManager.hpp index e21e19c..9aec4cf 100644 --- a/src/core/AnimationManager.hpp +++ b/src/core/AnimationManager.hpp @@ -19,12 +19,10 @@ namespace Hyprtoolkit { template void createAnimation(const VarType& v, PHLANIMVAR& pav, SP pConfig) { constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType; - const auto PAV = makeShared>(); + pav = makeUnique>(); - PAV->create(EAVTYPE, static_cast(this), PAV, v); - PAV->setConfig(pConfig); - - pav = std::move(PAV); + pav->create2(EAVTYPE, static_cast(this), pav, v); + pav->setConfig(pConfig); } Hyprutils::Animation::CAnimationConfigTree m_animationTree;