Skip to content

Commit b4d8a5a

Browse files
committed
DBManager: don't raise any errors while disconnecting signals from destroyed objects
1 parent c2118e7 commit b4d8a5a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

python/plugins/db_manager/table_viewer.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ def setDirty(self, val=True):
6767

6868
def _clear(self):
6969
if self.item is not None:
70-
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
70+
try:
71+
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
72+
except:
73+
# do not raise any error if self.item was deleted
74+
pass
75+
7176
self.item = None
7277
self.dirty = False
7378

@@ -83,11 +88,13 @@ def _loadTableData(self, table):
8388
self.setModel( table.tableDataModel(self) )
8489

8590
except DbError, e:
86-
QApplication.restoreOverrideCursor()
8791
DlgDbError.showError(e, self)
92+
return
8893

8994
else:
9095
self.update()
96+
97+
finally:
9198
QApplication.restoreOverrideCursor()
9299

93100

0 commit comments

Comments
 (0)