Stop helper only if formerly started.

Differential Revision: https://phabricator.kde.org/D25161
BUG: 413851
This commit is contained in:
Hartmut Goebel 2019-11-07 22:16:36 +00:00 committed by Andrius Štikonas
parent c9a08a593b
commit c02d59aa6d
1 changed files with 3 additions and 0 deletions

View File

@ -433,6 +433,8 @@ bool ExternalCommand::startHelper()
void ExternalCommand::stopHelper()
{
if (!helperStarted)
return;
auto *interface = new org::kde::kpmcore::externalcommand(QStringLiteral("org.kde.kpmcore.externalcommand"),
QStringLiteral("/Helper"), QDBusConnection::systemBus());
QByteArray request;
@ -441,6 +443,7 @@ void ExternalCommand::stopHelper()
QByteArray hash = QCryptographicHash::hash(request, QCryptographicHash::Sha512);
interface->exit(privateKey->signMessage(hash, QCA::EMSA3_Raw), nonce);
helperStarted = false;
delete privateKey;
delete init;
}