Permalink
Browse files

Fix for atexit crash when running GtkAgg backend but not actually sho…

…wing any windows.
  • Loading branch information...
1 parent 41c800e commit de18d9ab21146e98bd8413179b7a76ae994d3aea @mdboom mdboom committed May 6, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/matplotlib/backends/backend_gtk.py
@@ -549,7 +549,8 @@ def destroy(self, *args):
if _debug: print 'FigureManagerGTK.%s' % fn_name()
self.vbox.destroy()
self.window.destroy()
- self.canvas.destroy()
+ if hasattr(self, 'canvas'):
+ self.canvas.destroy()
if self.toolbar:
self.toolbar.destroy()
self.__dict__.clear() #Is this needed? Other backends don't have it.

0 comments on commit de18d9a

Please sign in to comment.