diff options
| author | Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> | 2026-02-14 18:09:25 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-14 13:09:25 +0000 |
| commit | 48176160ab953c33a391413ce6b927546d6a4b87 (patch) | |
| tree | 1e5fdc0115564e4c04f614edfe652fde76822d47 /src/protocols/CommitTiming.cpp | |
| parent | e5a2b9e5b03d6b1f2dbf88242ad34522e48fb3d9 (diff) | |
commit-timing: avoid use-after-free in timer callback (#13271)
Diffstat (limited to 'src/protocols/CommitTiming.cpp')
| -rw-r--r-- | src/protocols/CommitTiming.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/CommitTiming.cpp b/src/protocols/CommitTiming.cpp index c1fca990..9cc2da83 100644 --- a/src/protocols/CommitTiming.cpp +++ b/src/protocols/CommitTiming.cpp @@ -39,11 +39,11 @@ CCommitTimerResource::CCommitTimerResource(UP<CWpCommitTimerV1>&& resource_, SP< if (!state->timer) { state->timer = makeShared<CEventLoopTimer>( state->pendingTimeout, - [this, state](SP<CEventLoopTimer> self, void* data) { - if (!m_surface || !state) + [surface = m_surface, state](SP<CEventLoopTimer> self, void* data) { + if (!surface || !state) return; - m_surface->m_stateQueue.unlock(state, LOCK_REASON_TIMER); + surface->m_stateQueue.unlock(state, LOCK_REASON_TIMER); }, nullptr); g_pEventLoopManager->addTimer(state->timer); |
