matplotlib/matplotlib — Issue #711: no 'close_event' emitted with Qt4Agg backend
Author: geggo
Created: 2012-02-23 13:38:19+00:00
State: open

Dear developers,

it seems no 'close_event' is emitted when a figure is closed when using the qt4 backend. A short program demonstrating the behaviour:

import matplotlib
#matplotlib.use('TkAgg')
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
def onclose(event):
print 'onclose'
f = plt.figure(1)
f.canvas.mpl_connect('close_event', onclose)
plt.show()

With other backends (TkAgg, WxAgg) the callback is executed on closing a figure.

As a consequence of the missing close_event, timers for animations are not stopped when closing a figure, leading to an continous stream of errors 'underlying C/C++ object has been deleted' when using ipython.

Gregor Thalhammer