From fa1413c6408d8f5a898dd6996f29737120c8af47 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 31 Dec 2009 14:56:44 +0000 Subject: [PATCH] Fixed issue on emitting a signal which will change a table before the click has returned, which can crash Python svn: r13946 --- src/Simple/_SimpleTable.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Simple/_SimpleTable.py b/src/Simple/_SimpleTable.py index 4501ec3a7..5f116b0f9 100644 --- a/src/Simple/_SimpleTable.py +++ b/src/Simple/_SimpleTable.py @@ -168,8 +168,13 @@ class SimpleTable(object): elif self.__link[index]: objclass, handle = self.__link[index] if objclass == 'Person': + import gobject person = self.access.dbase.get_person_from_handle(handle) - self.simpledoc.doc.dbstate.change_active_person(person) + # If you emmit the signal here and it causes this table to be deleted, + # then you'll crash Python: + #self.simpledoc.doc.dbstate.change_active_person(person) + # So, let's return from this, then change the active person: + gobject.timeout_add(100, self.simpledoc.doc.dbstate.change_active_person, person) return True return False # didn't handle event