mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 19:45:58 +01:00
pointermgr: ensure compositor exist on destroy (#6216)
on exit of hyprland the CMonitor destroy signal comes after the compositor has been destructed, causing a heap use after free. add if check to ensure compositor exist and isnt shutting down when its triggered.
This commit is contained in:
parent
eea0a6a704
commit
4e42107d25
1 changed files with 5 additions and 1 deletions
|
@ -131,7 +131,11 @@ CPointerManager::CPointerManager() {
|
|||
PMONITOR->events.modeChanged.registerStaticListener([this](void* owner, std::any data) { onMonitorLayoutChange(); }, nullptr);
|
||||
PMONITOR->events.disconnect.registerStaticListener([this](void* owner, std::any data) { onMonitorLayoutChange(); }, nullptr);
|
||||
PMONITOR->events.destroy.registerStaticListener(
|
||||
[this](void* owner, std::any data) { std::erase_if(monitorStates, [](const auto& other) { return other->monitor.expired(); }); }, nullptr);
|
||||
[this](void* owner, std::any data) {
|
||||
if (g_pCompositor && !g_pCompositor->m_bIsShuttingDown)
|
||||
std::erase_if(monitorStates, [](const auto& other) { return other->monitor.expired(); });
|
||||
},
|
||||
nullptr);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue