Skip to content

Commit

Permalink
DBManager: trap RuntimeError when disconnecting signals from a delete…
Browse files Browse the repository at this point in the history
…d object
  • Loading branch information
brushtyler committed Sep 29, 2015
1 parent fea4ed9 commit ece1169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/plugins/db_manager/info_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def setDirty(self, val=True):

def _clear(self):
if self.item is not None:
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
## skip exception on RuntimeError fixes #6892
try:
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
except RuntimeError:
pass
self.item = None
self.dirty = False

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/layer_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def refresh(self):
self.setDirty(True)
self.loadPreview(self.item)

def loadPreview(self, item, force=False):
def loadPreview(self, item):
if item == self.item and not self.dirty:
return
self._clear()
Expand Down

0 comments on commit ece1169

Please sign in to comment.