Skip to content
Snippets Groups Projects
Commit 259c50c2 authored by Prince Gupta's avatar Prince Gupta :speech_balloon: Committed by Jean-Baptiste Kempf
Browse files

qt: fix memory leak in NetworkDeviceModel

*GetMediaSource returns a strong reference which must be
released by vlc_media_source_Release (see vlc_media_source_provider_GetMediaSource),
store the returned referenced in appropriate RAII handler so
it can be automatically removed at the end of scope
parent 92123ac2
No related branches found
No related tags found
1 merge request!5325qt: fix memory leak in NetworkDeviceModel
Pipeline #466801 passed with warnings with stage
in 16 minutes and 24 seconds
......@@ -220,8 +220,10 @@ public:
q->m_name += q->m_name.isEmpty() ? qfu( meta->longname ) : ", " + qfu( meta->longname );
emit q->nameChanged();
auto mediaSource = vlc_media_source_provider_GetMediaSource( provider,
meta->name );
MediaSourcePtr mediaSource(
vlc_media_source_provider_GetMediaSource(provider, meta->name)
, false );
if ( mediaSource == nullptr )
continue;
std::unique_ptr<MediaTreeListener> l{ new MediaTreeListener(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment