commit-timing: avoid use-after-free in timer callback (#13271)
This commit is contained in:
parent
e5a2b9e5b0
commit
48176160ab
1 changed files with 3 additions and 3 deletions
|
|
@ -39,11 +39,11 @@ CCommitTimerResource::CCommitTimerResource(UP<CWpCommitTimerV1>&& resource_, SP<
|
||||||
if (!state->timer) {
|
if (!state->timer) {
|
||||||
state->timer = makeShared<CEventLoopTimer>(
|
state->timer = makeShared<CEventLoopTimer>(
|
||||||
state->pendingTimeout,
|
state->pendingTimeout,
|
||||||
[this, state](SP<CEventLoopTimer> self, void* data) {
|
[surface = m_surface, state](SP<CEventLoopTimer> self, void* data) {
|
||||||
if (!m_surface || !state)
|
if (!surface || !state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_surface->m_stateQueue.unlock(state, LOCK_REASON_TIMER);
|
surface->m_stateQueue.unlock(state, LOCK_REASON_TIMER);
|
||||||
},
|
},
|
||||||
nullptr);
|
nullptr);
|
||||||
g_pEventLoopManager->addTimer(state->timer);
|
g_pEventLoopManager->addTimer(state->timer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue