Reduce memory leakage
We need to clean up the event queue when we're done.
Change-Id: I13a9eb77e978f4eab227a3a28dab8ebc8de94405 Reviewed-by: David Edmundson davidedmundson@kde.org (cherry picked from commit 1264e5f5)
applicable to 5.15 as well @davidedmundson?