From 0e3e420c383988fda13875350932e800f01962a4 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 2 Nov 2010 18:57:13 +0000 Subject: [PATCH] 4341: Error when adding a new place svn: r16119 --- src/gui/editors/displaytabs/backreflist.py | 5 +++++ src/gui/editors/editevent.py | 3 --- src/gui/editors/editmedia.py | 3 --- src/gui/editors/editplace.py | 3 --- src/gui/editors/editrepository.py | 3 --- src/gui/editors/editsource.py | 3 --- 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/gui/editors/displaytabs/backreflist.py b/src/gui/editors/displaytabs/backreflist.py index ae06bbf09..cdb07ac74 100644 --- a/src/gui/editors/displaytabs/backreflist.py +++ b/src/gui/editors/displaytabs/backreflist.py @@ -81,6 +81,11 @@ class BackRefList(EmbeddedList): def _cleanup_local_connects(self): self.model.disconnect(self.connectid) + def _cleanup_on_exit(self): + # model may be destroyed already in closing managedwindow + if hasattr(self, 'model'): + self.model.destroy() + def is_empty(self): return self.model.count == 0 diff --git a/src/gui/editors/editevent.py b/src/gui/editors/editevent.py index 56db6c123..3f5d1e6a5 100644 --- a/src/gui/editors/editevent.py +++ b/src/gui/editors/editevent.py @@ -214,9 +214,6 @@ class EditEvent(EditPrimary): self.track_ref_for_deletion("attr_list") self.track_ref_for_deletion("backref_list") - def _cleanup_on_exit(self): - self.backref_list.close() - def build_menu_names(self, event): return (_('Edit Event'), self.get_menu_title()) diff --git a/src/gui/editors/editmedia.py b/src/gui/editors/editmedia.py index 53dd4c9d0..49d06cea1 100644 --- a/src/gui/editors/editmedia.py +++ b/src/gui/editors/editmedia.py @@ -304,9 +304,6 @@ class EditMedia(EditPrimary): self.callback(self.obj) self.close() - def _cleanup_on_exit(self): - self.backref_list.close() - def data_has_changed(self): """ A date comparison can fail incorrectly because we have made the diff --git a/src/gui/editors/editplace.py b/src/gui/editors/editplace.py index bbb9a1f49..76b2956c3 100644 --- a/src/gui/editors/editplace.py +++ b/src/gui/editors/editplace.py @@ -283,9 +283,6 @@ class EditPlace(EditPrimary): self._setup_notebook_tabs(notebook) - def _cleanup_on_exit(self): - self.backref_tab.close() - def save(self, *obj): self.ok_button.set_sensitive(False) if self.object_is_empty(): diff --git a/src/gui/editors/editrepository.py b/src/gui/editors/editrepository.py index 7a5eed85d..c3afada9e 100644 --- a/src/gui/editors/editrepository.py +++ b/src/gui/editors/editrepository.py @@ -190,9 +190,6 @@ class EditRepository(EditPrimary): self.db.transaction_commit(trans, msg) self.close() - def _cleanup_on_exit(self): - self.backref_list.close() - class DeleteRepositoryQuery(object): def __init__(self, dbstate, uistate, repository, sources): self.obj = repository diff --git a/src/gui/editors/editsource.py b/src/gui/editors/editsource.py index 1ebd02708..ffa084cd1 100644 --- a/src/gui/editors/editsource.py +++ b/src/gui/editors/editsource.py @@ -208,9 +208,6 @@ class EditSource(EditPrimary): self.db.transaction_commit(trans, msg) self.close() - def _cleanup_on_exit(self): - self.backref_tab.close() - class DeleteSrcQuery(object): def __init__(self, dbstate, uistate, source, the_lists): self.source = source