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:
outfoxxed 2025-06-15 02:26:21 -07:00
parent 0499518143
commit 20322484b9
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -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();
}