mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
修复获取推流所有权导致引用计数紊乱的bug: #1397
This commit is contained in:
parent
756ec1364b
commit
3bf6ec8939
@ -91,7 +91,8 @@ std::shared_ptr<void> MediaSource::getOwnership() {
|
||||
return nullptr;
|
||||
}
|
||||
weak_ptr<MediaSource> weak_self = shared_from_this();
|
||||
return std::shared_ptr<void>(this, [weak_self](void *ptr) {
|
||||
//确保返回的Ownership智能指针不为空,0x01无实际意义
|
||||
return std::shared_ptr<void>((void *) 0x01, [weak_self](void *ptr) {
|
||||
auto strong_self = weak_self.lock();
|
||||
if (strong_self) {
|
||||
strong_self->_owned.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user