Skip to content

Commit bb99462

Browse files
committed
backend_qt4: avoid a crash at exit with PySide. Closes #551.
1 parent d664879 commit bb99462

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/backends/backend_qt4.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ def show(self):
361361
self.window.show()
362362

363363
def destroy( self, *args ):
364+
# check for qApp first, as PySide deletes it in its atexit handler
365+
if QtGui.QApplication.instance() is None: return
364366
if self.window._destroying: return
365367
self.window._destroying = True
366368
QtCore.QObject.disconnect( self.window, QtCore.SIGNAL( 'destroyed()' ),

0 commit comments

Comments
 (0)