diff options
| author | vaxerski <vaxry@vaxry.net> | 2024-08-19 18:44:22 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2024-08-19 18:44:22 +0200 |
| commit | c86db7bbb0cf14d4955ee3a4d13c0ed9f8a0e0ae (patch) | |
| tree | a20a91cd4835905a712647e660cd63b5ed903729 /src/Compositor.cpp | |
| parent | 272d9048706379201b761c3159c24a20cd62fad1 (diff) | |
monitor: avoid dangling references to old monitors being undestroyed
ref #7414
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 1437a653..75c22743 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2935,7 +2935,7 @@ PHLWINDOW CCompositor::windowForCPointer(CWindow* pWindow) { void CCompositor::onNewMonitor(SP<Aquamarine::IOutput> output) { // add it to real - auto PNEWMONITOR = g_pCompositor->m_vRealMonitors.emplace_back(makeShared<CMonitor>()); + auto PNEWMONITOR = g_pCompositor->m_vRealMonitors.emplace_back(makeShared<CMonitor>(output)); if (std::string("HEADLESS-1") == output->name) { g_pCompositor->m_pUnsafeOutput = PNEWMONITOR.get(); output->name = "FALLBACK"; // we are allowed to do this :) @@ -2944,7 +2944,6 @@ void CCompositor::onNewMonitor(SP<Aquamarine::IOutput> output) { Debug::log(LOG, "New output with name {}", output->name); PNEWMONITOR->szName = output->name; - PNEWMONITOR->output = output; PNEWMONITOR->self = PNEWMONITOR; const bool FALLBACK = g_pCompositor->m_pUnsafeOutput ? output == g_pCompositor->m_pUnsafeOutput->output : false; PNEWMONITOR->ID = FALLBACK ? MONITOR_INVALID : g_pCompositor->getNextAvailableMonitorID(output->name); |
