From 3bf6ec893929ca870cdb9113b25a34e96d55278f Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 26 Jan 2022 00:36:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=E6=8E=A8?= =?UTF-8?q?=E6=B5=81=E6=89=80=E6=9C=89=E6=9D=83=E5=AF=BC=E8=87=B4=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E8=AE=A1=E6=95=B0=E7=B4=8A=E4=B9=B1=E7=9A=84bug:=20#1?= =?UTF-8?q?397?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MediaSource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 2e95a324..8583f114 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -91,7 +91,8 @@ std::shared_ptr MediaSource::getOwnership() { return nullptr; } weak_ptr weak_self = shared_from_this(); - return std::shared_ptr(this, [weak_self](void *ptr) { + //确保返回的Ownership智能指针不为空,0x01无实际意义 + return std::shared_ptr((void *) 0x01, [weak_self](void *ptr) { auto strong_self = weak_self.lock(); if (strong_self) { strong_self->_owned.clear();