From c157d9c472cba6ef7e46a4025768d93a1bdb4eb2 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 29 Nov 2024 14:43:14 -0500 Subject: [PATCH 1/2] Fix crash when multiple dbus unlock calls are issued * Fixes #11512 --- src/gui/DatabaseOpenWidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index 14d8f4650e..7f633c7fd0 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -295,6 +295,11 @@ QString DatabaseOpenWidget::filename() void DatabaseOpenWidget::enterKey(const QString& pw, const QString& keyFile) { + if (unlockingDatabase()) { + qWarning("Ignoring unlock request for %s because of running unlock action.", qPrintable(m_filename)); + return; + } + m_ui->editPassword->setText(pw); m_ui->keyFileLineEdit->setText(keyFile); m_blockQuickUnlock = true; From ecfbead3f3f6c00f9deac723b95d630fcecf76dd Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 30 Nov 2024 10:15:20 -0500 Subject: [PATCH 2/2] Fix crash on Linux when database is closed without hardware key present * Fixes #11450 --- src/gui/osutils/DeviceListener.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/osutils/DeviceListener.cpp b/src/gui/osutils/DeviceListener.cpp index e51229b9c4..d480393080 100644 --- a/src/gui/osutils/DeviceListener.cpp +++ b/src/gui/osutils/DeviceListener.cpp @@ -35,7 +35,7 @@ void DeviceListener::connectSignals(DEVICELISTENER_IMPL* listener) { connect(listener, &DEVICELISTENER_IMPL::devicePlugged, this, [&](bool state, void* ctx, void* device) { // Wait a few ms to prevent USB device access conflicts - QTimer::singleShot(50, [&] { emit devicePlugged(state, ctx, device); }); + QTimer::singleShot(50, this, [&] { emit devicePlugged(state, ctx, device); }); }); }