Skip to content

Commit

Permalink
Fix crash on shutdown
Browse files Browse the repository at this point in the history
* Fixes "'DetailsPanel' object has no attribute '_table'" error on shutdown if the Results table is updated (item removed) while the Details Dialog is shown as a floating window.
* It seems that QApplication.quit() triggers some sort of refresh on the floating QDockWidget, which in turn makes calls to the underlying model that is possibly being destroyed, ie. there might be a race condition here.
* Closing or hiding the QDockWidget before the cal to quit() is a workaround. Similarly, this is already done in the quitTriggered() method anyway.
* This fixes #857.
  • Loading branch information
glubsy committed Apr 16, 2021
1 parent d18b8c1 commit 6b4b436
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ def shutdown(self):
self.willSavePrefs.emit()
self.prefs.save()
self.model.save()
# Workaround for #857, hide() or close().
if self.details_dialog is not None:
self.details_dialog.close()
QApplication.quit()

# --- Signals
Expand Down
2 changes: 1 addition & 1 deletion qt/details_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def update_options(self):
if not self.titleBarWidget(): # default title bar
self.setTitleBarWidget(QWidget()) # disables title bar
# Windows (and MacOS?) users cannot move a floating window which
# has not native decoration so we force it to dock for now
# has no native decoration so we force it to dock for now
if not ISLINUX:
self.setFloating(False)
elif self.titleBarWidget() is not None: # title bar is disabled
Expand Down

0 comments on commit 6b4b436

Please sign in to comment.