aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/desktop
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-08-24 15:22:10 +0200
committerVaxry <[email protected]>2024-08-24 15:22:10 +0200
commite45e606fbd7f7e805eb5a1c81482ea44b66e88d2 (patch)
tree40a71e882c1a7fe914235534dd5ddd1fbf2c3273 /src/desktop
parent688fe5c14781c63a1db23d4d02bf239283068ff6 (diff)
downloadHyprland-e45e606fbd7f7e805eb5a1c81482ea44b66e88d2.tar.gz
Hyprland-e45e606fbd7f7e805eb5a1c81482ea44b66e88d2.zip
layersurface: don't unref from monitor until dtor
reee
Diffstat (limited to 'src/desktop')
-rw-r--r--src/desktop/LayerSurface.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index 46aea86c..8d13bf19 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -71,6 +71,12 @@ CLayerSurface::~CLayerSurface() {
surface->unassign();
g_pHyprRenderer->makeEGLCurrent();
std::erase_if(g_pHyprOpenGL->m_mLayerFramebuffers, [&](const auto& other) { return other.first.expired() || other.first.lock() == self.lock(); });
+
+ 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; });
+ }
+ }
}
void CLayerSurface::onDestroy() {
@@ -107,12 +113,6 @@ 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)