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();