Description
Bug report
Bug summary
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.)
Code for reproduction
N/A
Matplotlib version
- Operating system:
- Matplotlib version: master
- Matplotlib backend (
print(matplotlib.get_backend())
): - Python version:
- Jupyter version (if applicable):
- Other libraries: