Fix crash when switching signed/encrypted emails very fast
Kleo::KeyCache internally uses a QEventLoop to block until it finishes initializing. The initialization happens the first time the user opens a signed or encrypted email. If they switch to another email before the KeyCache is done initializing it leads to a crash in MessageViewer, since message pointers change while MessageViewer is still "blocked" in OTP. To avoid the crash, and running a nested event loop in general, this change introduces KeyCacheMemento, which allows to wait for the KeyCache to initialize asynchronously before the MessagePart queries it. (cherry picked from commit 624cee41 from 23.04 branch, because I forgot to merge it to master, so it did not merge it to 23.08) BUGS: 463083
Please register or sign in to comment