Unverified Commit 3b92b040 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Wait for KeyCache in Readerstatus thread

When Kleopatra is not fully initialized the
updates from the ReaderStatus would block widgets
that try to react to the key infos received by
the Readerstatus.

This fixes a crash where a readerstatus update
with an uninitalized cache caused the openpgpwidget
to wait for the keycache even when it was destroyed
by closing the mainwindow.

part of:
GnuPG-Bug-Id: T5962
parent e0547e0c
Pipeline #174711 passed with stage
in 5 minutes and 9 seconds
......@@ -18,6 +18,7 @@
#include <Libkleo/Assuan>
#include <Libkleo/GnuPG>
#include <Libkleo/FileSystemWatcher>
#include <Libkleo/KeyCache>
#include <QGpgME/Debug>
......@@ -725,6 +726,11 @@ private:
std::list<Transaction> item;
std::vector<std::shared_ptr<Card> > oldCards;
while (!KeyCache::instance()->initialized()) {
qCDebug(KLEOPATRA_LOG) << "Waiting for Keycache to be initialized.";
Error err;
std::unique_ptr<Context> c = Context::createForEngine(AssuanEngine, &err);
if (err.code() == GPG_ERR_NOT_SUPPORTED) {
Supports Markdown
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