diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2024-08-23 15:06:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-23 14:06:52 +0100 |
| commit | df4f222482a7c2a1116ef5c91ba6e4b55d94ad6c (patch) | |
| tree | ed47f3192efa7add962237d5af647af1f42deb41 /src/desktop/LayerSurface.cpp | |
| parent | 3b663f4afcecb1abc93a61d6448183c5978f5cd2 (diff) | |
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.
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
| -rw-r--r-- | src/desktop/LayerSurface.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 8fd448ef..46aea86c 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -107,6 +107,12 @@ void CLayerSurface::onDestroy() { 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; layerSurface.reset(); if (surface) |
