From 6c321f2cb234de729ba2c2d9137349803a9c9528 Mon Sep 17 00:00:00 2001 From: davidliu Date: Sat, 14 May 2022 00:55:55 +0900 Subject: [PATCH] Properly remove observer upon deconstruction (#26) --- 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 ac912a7820..0e8044af3a 100644 --- a/pc/video_rtp_receiver.cc +++ b/pc/video_rtp_receiver.cc @@ -56,6 +56,8 @@ VideoRtpReceiver::VideoRtpReceiver( VideoRtpReceiver::~VideoRtpReceiver() { RTC_DCHECK_RUN_ON(&signaling_thread_checker_); RTC_DCHECK(!media_channel_); + + track_->UnregisterObserver(this); } std::vector VideoRtpReceiver::stream_ids() const {