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.
This commit is contained in:
parent
75c0675e14
commit
b46dc9ee0c
1 changed files with 1 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ void CMonitorFrameScheduler::onFrame() {
|
||||||
void CMonitorFrameScheduler::onFinishRender() {
|
void CMonitorFrameScheduler::onFinishRender() {
|
||||||
m_sync = CEGLSync::create(); // this destroys the old sync
|
m_sync = CEGLSync::create(); // this destroys the old sync
|
||||||
g_pEventLoopManager->doOnReadable(m_sync->fd().duplicate(), [this, mon = m_monitor] {
|
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;
|
return;
|
||||||
onSyncFired();
|
onSyncFired();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue