forked from quickshell/quickshell
wayland/layershell: fix bridge destructor use after free on reload
Under some conditions, Qt will recreate the layer surface. The layer surface destructor tries to destroy the bridge, but doesn't actually need to because the bridge is a child of the QWindow owning the layer, meaning not destroying it is actually completely fine.
This commit is contained in:
parent
0499518143
commit
20322484b9
1 changed files with 4 additions and 1 deletions
|
@ -174,7 +174,10 @@ LayerSurface::LayerSurface(LayerShellIntegration* shell, QtWaylandClient::QWayla
|
|||
}
|
||||
|
||||
LayerSurface::~LayerSurface() {
|
||||
delete this->bridge;
|
||||
if (this->bridge && this->bridge->surface == this) {
|
||||
this->bridge->surface = nullptr;
|
||||
}
|
||||
|
||||
this->destroy();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue