@@ -299,30 +299,30 @@ void NativeAnimatedNodesManager::startAnimatingNode(
299299 if (auto iter = activeAnimations_.find (animationId);
300300 iter != activeAnimations_.end ()) {
301301 // reset animation config
302- auto animation = iter->second ;
302+ auto & animation = iter->second ;
303303 animation->updateConfig (config);
304304 } else if (animatedNodes_.contains (animatedNodeTag)) {
305305 auto type = config[" type" ].asString ();
306306 auto typeEnum = AnimationDriver::getDriverTypeByName (type);
307- std::shared_ptr <AnimationDriver> animation = nullptr ;
307+ std::unique_ptr <AnimationDriver> animation = nullptr ;
308308 if (typeEnum) {
309309 switch (typeEnum.value ()) {
310310 case AnimationDriverType::Frames: {
311- animation = std::make_shared <FrameAnimationDriver>(
311+ animation = std::make_unique <FrameAnimationDriver>(
312312 animationId, animatedNodeTag, endCallback, config, this );
313313 } break ;
314314 case AnimationDriverType::Spring: {
315- animation = std::make_shared <SpringAnimationDriver>(
315+ animation = std::make_unique <SpringAnimationDriver>(
316316 animationId, animatedNodeTag, endCallback, config, this );
317317 } break ;
318318 case AnimationDriverType::Decay: {
319- animation = std::make_shared <DecayAnimationDriver>(
319+ animation = std::make_unique <DecayAnimationDriver>(
320320 animationId, animatedNodeTag, endCallback, config, this );
321321 } break ;
322322 }
323323 if (animation) {
324- activeAnimations_.insert ({animationId, animation});
325324 animation->startAnimation ();
325+ activeAnimations_.insert ({animationId, std::move (animation)});
326326 }
327327 } else {
328328 LOG (ERROR) << " Unknown AnimationDriver type " << type;
0 commit comments