Issue 1:
Bug report

Using FuncAnimation with a generator causes a crash when the generator raises a StopIteration.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation

fig, ax = plt.subplots()
plt.plot([1,2,3],[2,4,3])
def update(frame):
print(frame)
return []
animation = FuncAnimation(fig, update, frames=iter(range(10)), blit=True, interval=100)
plt.show()

Output:

$ python animation_crash.py
0
1
2
3
4
5
6
7
8
9
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1238, in _on_timer
ret = func(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/animation.py", line 1462, in _step
self._init_draw()
File "/usr/lib/python3.7/site-packages/matplotlib/animation.py", line 1740, in _init_draw
self._draw_frame(next(self.new_frame_seq()))
StopIteration
Abgebrochen (Speicherabzug geschrieben)

Matplotlib version

Operating System: Arch linux, 64-bit

Matplotlib version: 3.0.3-1 (using pacman)

Matplotlib backend: Qt5Agg

Coredump:

[Current thread is 1 (Thread 0x7f2d24492600 (LWP 25813))]
(gdb) info stack
#0 0x00007f2d249d0d7f in raise () at /usr/lib/libc.so.6
#1 0x00007f2d249bb672 in abort () at /usr/lib/libc.so.6
#2 0x00007f2d1f79a7fc in () at /usr/lib/libQt5Core.so.5
#3 0x00007f2d1fd2b048 in () at /usr/lib/python3.7/site-packages/PyQt5/QtCore.so
#4 0x00007f2d1fe8b216 in () at /usr/lib/python3.7/site-packages/PyQt5/QtCore.so
#5 0x00007f2d1fe8bcd0 in () at /usr/lib/python3.7/site-packages/PyQt5/QtCore.so
#6 0x00007f2d1f9bb94d in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#7 0x00007f2d1f9c7ab8 in QTimer::timeout(QTimer::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#8 0x00007f2d1fe34c9c in () at /usr/lib/python3.7/site-packages/PyQt5/QtCore.so
#9 0x00007f2d1f9bc10b in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#10 0x00007f2d1fe34b4c in () at /usr/lib/python3.7/site-packages/PyQt5/QtCore.so
#11 0x00007f2d1ba68e24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#12 0x00007f2d1ba706e1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#13 0x00007f2d1c114b3f in () at /usr/lib/python3.7/site-packages/PyQt5/QtWidgets.so
#14 0x00007f2d1f990e99 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#15 0x00007f2d1f9e6095 in QTimerInfoList::activateTimers() () at /usr/lib/libQt5Core.so.5
#16 0x00007f2d1f9e6922 in () at /usr/lib/libQt5Core.so.5
#17 0x00007f2d20dd3a2f in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#18 0x00007f2d20dd55e9 in () at /usr/lib/libglib-2.0.so.0
#19 0x00007f2d20dd562e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#20 0x00007f2d1f9e6ce9 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/libQt5Core.so.5
#21 0x00007f2d1f98fb2c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#22 0x00007f2d1f997e36 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#23 0x00007f2d1c1135cd in () at /usr/lib/python3.7/site-packages/PyQt5/QtWidgets.so
#24 0x00007f2d24775a78 in _PyMethodDef_RawFastCallKeywords () at /usr/lib/libpython3.7m.so.1.0
#25 0x00007f2d24775d11 in _PyCFunction_FastCallKeywords () at /usr/lib/libpython3.7m.so.1.0
#26 0x00007f2d247ec8eb in _PyEval_EvalFrameDefault () at /usr/lib/libpython3.7m.so.1.0
#27 0x00007f2d247752eb in _PyFunction_FastCallKeywords () at /usr/lib/libpython3.7m.so.1.0
#28 0x00007f2d247ec2b3 in _PyEval_EvalFrameDefault () at /usr/lib/libpython3.7m.so.1.0
--Type <RET> for more, q to quit, c to continue without paging--
#29 0x00007f2d2472eb99 in _PyEval_EvalCodeWithName () at /usr/lib/libpython3.7m.so.1.0
#30 0x00007f2d2472fdec in _PyFunction_FastCallDict () at /usr/lib/libpython3.7m.so.1.0
#31 0x00007f2d2473f908 in _PyObject_Call_Prepend () at /usr/lib/libpython3.7m.so.1.0
#32 0x00007f2d2473033b in PyObject_Call () at /usr/lib/libpython3.7m.so.1.0
#33 0x00007f2d247e943c in _PyEval_EvalFrameDefault () at /usr/lib/libpython3.7m.so.1.0
#34 0x00007f2d2472eb99 in _PyEval_EvalCodeWithName () at /usr/lib/libpython3.7m.so.1.0
#35 0x00007f2d24775492 in _PyFunction_FastCallKeywords () at /usr/lib/libpython3.7m.so.1.0
#36 0x00007f2d247ec2b3 in _PyEval_EvalFrameDefault () at /usr/lib/libpython3.7m.so.1.0
#37 0x00007f2d2472eb99 in _PyEval_EvalCodeWithName () at /usr/lib/libpython3.7m.so.1.0
#38 0x00007f2d2472fab4 in PyEval_EvalCodeEx () at /usr/lib/libpython3.7m.so.1.0
#39 0x00007f2d2472fadc in PyEval_EvalCode () at /usr/lib/libpython3.7m.so.1.0
#40 0x00007f2d24859c94 in () at /usr/lib/libpython3.7m.so.1.0
#41 0x00007f2d2485b8be in PyRun_FileExFlags () at /usr/lib/libpython3.7m.so.1.0
#42 0x00007f2d2485cc75 in PyRun_SimpleFileExFlags () at /usr/lib/libpython3.7m.so.1.0
#43 0x00007f2d2485eeb7 in () at /usr/lib/libpython3.7m.so.1.0
#44 0x00007f2d2485f0fc in _Py_UnixMain () at /usr/lib/libpython3.7m.so.1.0
#45 0x00007f2d249bd223 in __libc_start_main () at /usr/lib/libc.so.6
#46 0x0000561e1056f05e in _start ()

Issue 2:
Using the widget "Cursor" with "use but=True" occurs the occurrence of duplicate crosshairs.

When "useblit=False" work correct."Cursor" is activated in the event of a button (PyQt5)

self.btnQuit.clicked.connect(self.cur)
******************************************
def cur(self):
self.cursor = Cursor(self.ax, useblit=True, color='magenta', linewidth=1)

I place GIF animation as it [happens.

https://ibb.co/F5Hhc46