Open
Conversation
to avoid calling the dispose method if controller already disposed.
also added condition to cancel all animations before disposing the controller to avoid any exceptions.
to avoid it being called twice on navigation.
Owner
Author
|
bugbot run |
| } catch (e) { | ||
| rethrow; | ||
| } finally { | ||
| isAnimating.value = _activeAnimationControllers.isNotEmpty; |
There was a problem hiding this comment.
Bug: Animation Controller Leak in Animation Methods
The animatePoint and animateSequence methods can leak AnimationController instances. If an exception occurs after a controller is added to _activeAnimationControllers but before its completion listener removes it, the controller remains in the list. This prevents disposal, leading to a memory leak and an inaccurate isAnimating state.
Additional Locations (1)
| controller.dispose(); | ||
| } | ||
| _activeAnimationControllers.clear(); | ||
| isAnimating.value = false; |
There was a problem hiding this comment.
Bug: Animation Controller Disposal Causes Concurrent Modification
In stopAllAnimations, calling controller.stop() triggers the animation's status listener. This listener disposes the controller and removes it from _activeAnimationControllers, causing a double disposal and a concurrent modification error while iterating the list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Implemented by @msamoeed in #25
Enhanced MeshGradientController with Integrated Sequence Repetition
Changes
animateSequencemethod to includerepeatCountandpauseBetweenRepeatsparametersanimateSequencerepeatSequenceAnimationmethodanimateSequencefor better code organization and reusabilityMotivation
This update streamlines the API for animating mesh gradient sequences by incorporating repetition functionality directly into the
animateSequencemethod. It simplifies usage and reduces code duplication while maintaining flexibility for complex animations.Impact
Usage Example
This PR enhances the MeshGradientController's capabilities while simplifying its interface, making it more intuitive for developers to create complex, repeating gradient animations.