Only remove keys on exit if they would remove on lock (#2985)

* Don't remove keys on app exit that would not be removed due to database locking.
* Restores behavior from 2.3.4
* Fixes #2980
This commit is contained in:
Jonathan White 2019-04-12 13:55:28 -04:00 committed by Janek Bevendorff
parent bc5173bac7
commit cc27a367d6

View File

@ -45,8 +45,11 @@ SSHAgent::~SSHAgent()
{
auto it = m_addedKeys.begin();
while (it != m_addedKeys.end()) {
OpenSSHKey key = it.key();
removeIdentity(key);
// Remove key if requested to remove on lock
if (it.value()) {
OpenSSHKey key = it.key();
removeIdentity(key);
}
it = m_addedKeys.erase(it);
}
}