Commit 1dbe3708 authored by Andreas Haratzis's avatar Andreas Haratzis Committed by Vlad Zahorodnii

Fix for potential use-after-free introduced in a3b50500

If showOnScreenEdge is called, immediately followed by the client's destruction, it's possible that the next event queue process will call raiseClient with a destroyed client.
We avoid this by using singleShot that is lifetime-aware.
parent 0c266e76
......@@ -718,7 +718,7 @@ void XdgToplevelClient::showOnScreenEdge()
// ShowOnScreenEdge can be called by an Edge, and hideClient could destroy the Edge
// Use the singleshot to avoid use-after-free
QTimer::singleShot(0, [this](){
QTimer::singleShot(0, this, [this](){
hideClient(false);
workspace()->raiseClient(this);
if (m_plasmaShellSurface->panelBehavior() == PlasmaShellSurfaceInterface::PanelBehavior::AutoHide) {
......
Markdown is supported
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