Close connection to agent after each transaction

This is the proper thing to do and fixes problems that
the scdaemon does not release the smartcard reader

It's also a workardound for a deadlock on windows caused by
GnuPG-Bug-Id: 2982
parent 77ca3fb4
......@@ -463,22 +463,20 @@ private Q_SLOTS:
private:
void run() Q_DECL_OVERRIDE {
std::shared_ptr<Context> gpgAgent;
while (true) {
std::shared_ptr<Context> gpgAgent;
QByteArray command;
bool nullSlot = false;
std::list<Transaction> item;
std::vector<std::shared_ptr<Card> > oldCards;
if (!gpgAgent) {
Error err;
std::unique_ptr<Context> c = Context::createForEngine(AssuanEngine, &err);
if (err.code() == GPG_ERR_NOT_SUPPORTED) {
return;
}
gpgAgent = std::shared_ptr<Context>(c.release());
Error err;
std::unique_ptr<Context> c = Context::createForEngine(AssuanEngine, &err);
if (err.code() == GPG_ERR_NOT_SUPPORTED) {
return;
}
gpgAgent = std::shared_ptr<Context>(c.release());
KDAB_SYNCHRONIZED(m_mutex) {
......
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