mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-17 05:06:00 +01:00
layersurface: remove layer on destroy from monitor (#7457)
remove destroyed layer weakptrs on destroy, we can hit multiple null ptr derefs in renderering on mirroring and unmirroring displays otherwise.
This commit is contained in:
parent
3b663f4afc
commit
df4f222482
1 changed files with 6 additions and 0 deletions
|
@ -107,6 +107,12 @@ void CLayerSurface::onDestroy() {
|
||||||
g_pHyprRenderer->damageBox(&geomFixed);
|
g_pHyprRenderer->damageBox(&geomFixed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& mon : g_pCompositor->m_vRealMonitors) {
|
||||||
|
for (auto& lsl : mon->m_aLayerSurfaceLayers) {
|
||||||
|
std::erase_if(lsl, [this](auto& ls) { return ls.expired() || ls.get() == this; });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
readyToDelete = true;
|
readyToDelete = true;
|
||||||
layerSurface.reset();
|
layerSurface.reset();
|
||||||
if (surface)
|
if (surface)
|
||||||
|
|
Loading…
Reference in a new issue