From d83fff3b629aec62b2e79876115495ed5fb1fc64 Mon Sep 17 00:00:00 2001 From: prculley Date: Wed, 8 Jan 2020 10:26:04 -0600 Subject: [PATCH] Try to fix exceptions on ManagedWindow close Issues #10252, #10642, #10821, #11163, #11440, #11476, #11482, #11508 --- gramps/gui/managedwindow.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index b9aff7e90..43c8ed78d 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -32,6 +32,14 @@ the create/deletion of dialog windows. import os from io import StringIO import html +import logging + +#------------------------------------------------------------------------- +# +# Set up logging +# +#------------------------------------------------------------------------- +_LOG = logging.getLogger(".") #------------------------------------------------------------------------- # # GNOME/GTK @@ -575,6 +583,9 @@ class ManagedWindow: Takes care of closing children and removing itself from menu. """ + if hasattr(self, 'opened') and not self.opened: + _LOG.warning("Tried to close a ManagedWindow more than once.") + return # in case close somehow gets called again self.opened = False self._save_position(save_config=False) # the next line will save it self._save_size()