summaryrefslogtreecommitdiff
path: root/src/helpers/MonitorFrameScheduler.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-07-17 21:59:20 +0200
committerGitHub <noreply@github.com>2025-07-17 21:59:20 +0200
commitb46dc9ee0c62ad825f79511dd2b4aaeffc274048 (patch)
treeda2fed1206fbf522f5f26bdd0a6b1018b984d38e /src/helpers/MonitorFrameScheduler.cpp
parent75c0675e14655d7a859f184009360bd264806123 (diff)
framescheduler: dont if check deleted weakpointer (#11063)
if m_monitor is destroyed the doOnReadable will eventually hit UB on destruction if checking a destroyed m_monitor. acctually use the captured mon weak pointer.
Diffstat (limited to 'src/helpers/MonitorFrameScheduler.cpp')
-rw-r--r--src/helpers/MonitorFrameScheduler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helpers/MonitorFrameScheduler.cpp b/src/helpers/MonitorFrameScheduler.cpp
index 0dc79159..d05c9694 100644
--- a/src/helpers/MonitorFrameScheduler.cpp
+++ b/src/helpers/MonitorFrameScheduler.cpp
@@ -103,7 +103,7 @@ void CMonitorFrameScheduler::onFrame() {
void CMonitorFrameScheduler::onFinishRender() {
m_sync = CEGLSync::create(); // this destroys the old sync
g_pEventLoopManager->doOnReadable(m_sync->fd().duplicate(), [this, mon = m_monitor] {
- if (!m_monitor) // might've gotten destroyed
+ if (!mon) // might've gotten destroyed
return;
onSyncFired();
});