mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 12:41:55 -07: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:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user