dcsctp: assert that CreateTimeout returns a usable pointer
BUG=None Change-Id: I97852d5222a4a722e61b450fbe446dd949b6840e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238802 Reviewed-by: Victor Boivie <boivie@webrtc.org> Commit-Queue: Victor Boivie <boivie@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35412}
This commit is contained in:
parent
a18cad9c09
commit
c3a1ea1b3f
@ -144,9 +144,11 @@ std::unique_ptr<Timer> TimerManager::CreateTimer(absl::string_view name,
|
||||
// after 800 million reconnections on a single socket. Ensure this will never
|
||||
// happen.
|
||||
RTC_CHECK_NE(*id, std::numeric_limits<uint32_t>::max());
|
||||
std::unique_ptr<Timeout> timeout = create_timeout_();
|
||||
RTC_CHECK(timeout != nullptr);
|
||||
auto timer = absl::WrapUnique(new Timer(
|
||||
id, name, std::move(on_expired), [this, id]() { timers_.erase(id); },
|
||||
create_timeout_(), options));
|
||||
std::move(timeout), options));
|
||||
timers_[id] = timer.get();
|
||||
return timer;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user