diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 621b2889..f97c386d 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -214,6 +214,8 @@ void CMonitor::onDisconnect() { g_pCompositor->m_bUnsafeState = true; + std::erase_if(g_pCompositor->m_vMonitors, [&](std::shared_ptr& el) { return el.get() == this; }); + return; }