mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Fix crash on shutdown
* 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.
This commit is contained in:
parent
d18b8c10ec
commit
6b4b436251
@ -271,6 +271,9 @@ class DupeGuru(QObject):
|
|||||||
self.willSavePrefs.emit()
|
self.willSavePrefs.emit()
|
||||||
self.prefs.save()
|
self.prefs.save()
|
||||||
self.model.save()
|
self.model.save()
|
||||||
|
# Workaround for #857, hide() or close().
|
||||||
|
if self.details_dialog is not None:
|
||||||
|
self.details_dialog.close()
|
||||||
QApplication.quit()
|
QApplication.quit()
|
||||||
|
|
||||||
# --- Signals
|
# --- Signals
|
||||||
|
@ -51,7 +51,7 @@ class DetailsDialog(QDockWidget):
|
|||||||
if not self.titleBarWidget(): # default title bar
|
if not self.titleBarWidget(): # default title bar
|
||||||
self.setTitleBarWidget(QWidget()) # disables title bar
|
self.setTitleBarWidget(QWidget()) # disables title bar
|
||||||
# Windows (and MacOS?) users cannot move a floating window which
|
# 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:
|
if not ISLINUX:
|
||||||
self.setFloating(False)
|
self.setFloating(False)
|
||||||
elif self.titleBarWidget() is not None: # title bar is disabled
|
elif self.titleBarWidget() is not None: # title bar is disabled
|
||||||
|
Loading…
x
Reference in New Issue
Block a user