From 1ac52d7a1194ae6ed6cc36c13854acbeba1baba6 Mon Sep 17 00:00:00 2001 From: davidliu Date: Wed, 11 May 2022 21:59:51 +0900 Subject: [PATCH] Properly remove observer upon deconstruction --- pc/video_rtp_receiver.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pc/video_rtp_receiver.cc b/pc/video_rtp_receiver.cc index ae249d15ad..4612a07431 100644 --- a/pc/video_rtp_receiver.cc +++ b/pc/video_rtp_receiver.cc @@ -60,6 +60,8 @@ VideoRtpReceiver::~VideoRtpReceiver() { RTC_DCHECK_RUN_ON(&signaling_thread_checker_); RTC_DCHECK(stopped_); RTC_DCHECK(!media_channel_); + + track_->UnregisterObserver(this); } std::vector VideoRtpReceiver::stream_ids() const {