From 6bab48a92b927082adeec4062966fa7454a1e544 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 4 Oct 2012 00:07:59 +0000 Subject: [PATCH] 4145: During book report creation svn: r20515 --- gramps/gui/plug/report/_reportdialog.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py index a6af41f01..702ac7588 100644 --- a/gramps/gui/plug/report/_reportdialog.py +++ b/gramps/gui/plug/report/_reportdialog.py @@ -109,13 +109,14 @@ class ReportDialog(ManagedWindow): Close itself. cleanup things that can prevent garbage collection """ - totwidg = range(len(self.widgets)) - totwidg.reverse() - for ind in totwidg: - if hasattr(self.widgets[ind][1], 'clean_up'): - self.widgets[ind][1].clean_up() - del self.widgets[ind] - delattr(self, 'widgets') + if hasattr(self, 'widgets'): # handle pathlogical bug 4145 + totwidg = range(len(self.widgets)) + totwidg.reverse() + for ind in totwidg: + if hasattr(self.widgets[ind][1], 'clean_up'): + self.widgets[ind][1].clean_up() + del self.widgets[ind] + delattr(self, 'widgets') for name, fram in self.frames.iteritems(): totwidg = range(len(fram)) totwidg.reverse()