Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffd4581

Browse files
committed
Merge pull request matplotlib#106 from mdboom/gtk_crash
Gtk crash
2 parents 53f8139 + 91e7d98 commit ffd4581

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/backends/backend_gtk.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,13 @@ def notify_axes_change(fig):
547547

548548
def destroy(self, *args):
549549
if _debug: print 'FigureManagerGTK.%s' % fn_name()
550-
self.vbox.destroy()
551-
self.window.destroy()
552-
self.canvas.destroy()
553-
if self.toolbar:
550+
if hasattr(self, 'vbox'):
551+
self.vbox.destroy()
552+
if hasattr(self, 'window'):
553+
self.window.destroy()
554+
if hasattr(self, 'canvas'):
555+
self.canvas.destroy()
556+
if hasattr(self, 'toolbar'):
554557
self.toolbar.destroy()
555558
self.__dict__.clear() #Is this needed? Other backends don't have it.
556559

0 commit comments

Comments
 (0)