Commit e2cc3b62 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Use new UniqueLock to avoid error-prone manual unlocking

parent fa654bd7
Pipeline #100812 passed with stage
in 14 minutes and 15 seconds
......@@ -30,7 +30,7 @@ option(DISABLE_KWATCHGNUPG "Don't build the kwatchgnupg tool [default=OFF]" OFF)
# Standalone build. Find / include everything necessary.
set(KF5_MIN_VERSION "5.88.0")
set(KMIME_VERSION "5.19.40")
set(LIBKLEO_VERSION "5.19.44")
set(LIBKLEO_VERSION "5.19.45")
set(QT_REQUIRED_VERSION "5.15.2")
set(GPGME_REQUIRED_VERSION "1.13.1")
set(BOOST_REQUIRED_VERSION "1.58")
......
......@@ -17,6 +17,7 @@
#include <Libkleo/Debug>
#include <Libkleo/KeyCache>
#include <Libkleo/KeyGroup>
#include <Libkleo/UniqueLock>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -62,14 +63,14 @@ void GroupsConfigPage::Private::onKeysMayHaveChanged()
{
static QMutex mutex;
if (!mutex.tryLock()) {
const UniqueLock lock{mutex, Kleo::tryToLock};
if (!lock) {
// prevent reentrace
return;
}
if (savingChanges) {
qCDebug(KLEOPATRA_LOG) << __func__ << "ignoring changes caused by ourselves";
mutex.unlock();
return;
}
if (!changed) {
......@@ -91,7 +92,6 @@ void GroupsConfigPage::Private::onKeysMayHaveChanged()
q->load();
}
}
mutex.unlock();
}
GroupsConfigPage::GroupsConfigPage(QWidget *parent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment