diff --git a/src/Pusher/MediaPusher.cpp b/src/Pusher/MediaPusher.cpp index 16a08925..51f4c59a 100644 --- a/src/Pusher/MediaPusher.cpp +++ b/src/Pusher/MediaPusher.cpp @@ -46,7 +46,7 @@ MediaPusher::MediaPusher(const string &schema, MediaPusher::~MediaPusher() { } void MediaPusher::publish(const string &strUrl) { - _parser = PusherBase::createPusher(_src,strUrl); + _parser = PusherBase::createPusher(_src.lock(),strUrl); _parser->setOnShutdown(_shutdownCB); _parser->setOnPublished(_publishCB); _parser->mINI::operator=(*this); diff --git a/src/Pusher/MediaPusher.h b/src/Pusher/MediaPusher.h index 924a175d..7d127ef2 100644 --- a/src/Pusher/MediaPusher.h +++ b/src/Pusher/MediaPusher.h @@ -49,9 +49,8 @@ public: virtual ~MediaPusher(); void publish(const string &strUrl) override; EventPoller::Ptr getPoller(); - private: - MediaSource::Ptr _src; + std::weak_ptr _src; }; } /* namespace mediakit */