Fix deadlock when selecting encrypt
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 8 Oct 2018 13:19:58 +0000 (15:19 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 8 Oct 2018 13:19:58 +0000 (15:19 +0200)
commitcf47f74df6534d340e7334227168c919596c542d
tree78d0e58ee6be3616b1b35c7181c7e5844839ba70
parent9ccdc0cdc02583ba486535a24660cb94d5c5946f
Fix deadlock when selecting encrypt

* src/mail.cpp (Mail::locateAllCryptoRecipients_o): Use a copy
of the mail map instead of a locked instance.

--
Locking the mail map for a complex operation is a bad
idea. What happened here is that locateKeys_o can start
different threads and those threads can use "Mail::isValidPtr" which
uses the s_mail_map and locks it accordingly.
So there is a deadlock.
src/mail.cpp