diff options
author | vaxerski <[email protected]> | 2024-08-19 18:44:22 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2024-08-19 18:44:22 +0200 |
commit | c86db7bbb0cf14d4955ee3a4d13c0ed9f8a0e0ae (patch) | |
tree | a20a91cd4835905a712647e660cd63b5ed903729 /src/events | |
parent | 272d9048706379201b761c3159c24a20cd62fad1 (diff) | |
download | Hyprland-c86db7bbb0cf14d4955ee3a4d13c0ed9f8a0e0ae.tar.gz Hyprland-c86db7bbb0cf14d4955ee3a4d13c0ed9f8a0e0ae.zip |
monitor: avoid dangling references to old monitors being undestroyed
ref #7414
Diffstat (limited to 'src/events')
-rw-r--r-- | src/events/Events.hpp | 1 | ||||
-rw-r--r-- | src/events/Monitors.cpp | 25 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/events/Events.hpp b/src/events/Events.hpp index 8e73f54a..0af16f64 100644 --- a/src/events/Events.hpp +++ b/src/events/Events.hpp @@ -27,7 +27,6 @@ namespace Events { // Monitor part 2 the sequel DYNLISTENFUNC(monitorFrame); - DYNLISTENFUNC(monitorDestroy); DYNLISTENFUNC(monitorStateRequest); DYNLISTENFUNC(monitorDamage); DYNLISTENFUNC(monitorNeedsFrame); diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 60fb5bef..9d2210f6 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -85,31 +85,6 @@ void Events::listener_monitorFrame(void* owner, void* data) { } } -void Events::listener_monitorDestroy(void* owner, void* data) { - CMonitor* pMonitor = (CMonitor*)owner; - - for (auto& m : g_pCompositor->m_vRealMonitors) { - if (m->output == pMonitor->output) { - pMonitor = m.get(); - break; - } - } - - if (!pMonitor) - return; - - Debug::log(LOG, "Destroy called for monitor {}", pMonitor->szName); - - pMonitor->onDisconnect(true); - - pMonitor->output = nullptr; - pMonitor->m_bRenderingInitPassed = false; - - Debug::log(LOG, "Removing monitor {} from realMonitors", pMonitor->szName); - - std::erase_if(g_pCompositor->m_vRealMonitors, [&](SP<CMonitor>& el) { return el.get() == pMonitor; }); -} - void Events::listener_monitorNeedsFrame(void* owner, void* data) { const auto PMONITOR = (CMonitor*)owner; |