You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn when a non-started animation is gc'ed. #18438
Animations need to be held in a reference so that they are not gc'ed. I have argued against that behavior in #16221, but as long as we keep it, we could at least add an internal flag tracking whether the animation has been started (I have not checked whether it would be best for this to go in _start or _init_draw or elsewhere), and emit a warning in __del__ if the animation is gc'ed without ever being started, to help confused users (https://discourse.matplotlib.org/t/could-animation-be-triggered-only-when-an-onclick-event-in-silder/21534/2). (Unless someone can think of a reason to instantiate an animation and not start it... and even then we could add a flag i_really_meant_for_this_to_be_perhaps_gced_without_ever_running=True, but let's not get ahead of ourselves.)
Activity
QuLogic commentedon Sep 10, 2020
It appears that using
_init_drawis necessary, as_startis never called if you useAnimation.save.Warn if an animation is gc'd before doing anything.
Warn if an animation is gc'd before doing anything.
Warn if an animation is gc'd before doing anything.
Warn if an animation is gc'd before doing anything.