Skip to content
Verified Commit 938fab62 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

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
parent 0d689118
Pipeline #488847 passed with stage
in 8 minutes and 38 seconds
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