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.
This commit is contained in:
parent
0c266e760b
commit
1dbe3708f5
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue