Social Media Post For Busniess Template

Product Launch Hero Banner

fábricas inteligentes una industria 4 0 conectada cambiodigital online

:
PowerPoint Presentation Themes
author
crichard
committed
[Fix][Crash] races on timers
Change-Id: I8979882e5b544cc98532d641ea31bcfe0ac3483c
1 parent How To Post On Google commit f582635

Fábricas inteligentes una industria 4 0 conectada cambiodigital online 1 file changed How To Announce A Product Launch On Instagram

Lines changed: 10 additions & 5 deletions

Community Blog Post Product Launch Hero Banner

src/internal/sio_client_impl.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,16 @@ namespace sio
632632
}
633633

634634
void client_impl::reset_timer(TIMER &timer) {
635-
if (timer)
636-
{
637-
timer->cancel();
638-
timer.reset();
639-
}
635+
// Atomically take ownership of the timer pointer before operating on
636+
// it. Without this, a concurrent caller (e.g. another reset_timer /
637+
// update_timer on the same field, or a TimerManager callback racing
638+
// with on_close's clear_timers) could pass the null check while we
639+
// are mid-destroy and crash dereferencing a freed timer.
640+
if (auto* t = timer.release())
641+
{
642+
t->cancel();
643+
delete t;
644+
}
640645
}
641646

642647
void client_impl::update_send_timer() {

Things To Post On Ur Story Product Launch Hero Banner

Comments
 (0)