[vlc-devel] [PATCH 2/3] qt: fix memory leaks when adding elements to the playlist
Pierre Lamot
pierre at videolabs.io
Fri Apr 12 14:22:40 CEST 2019
---
modules/gui/qt/components/mediacenter/mcmedialib.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/components/mediacenter/mcmedialib.cpp b/modules/gui/qt/components/mediacenter/mcmedialib.cpp
index 2fdf3159a0..7d08448bd2 100644
--- a/modules/gui/qt/components/mediacenter/mcmedialib.cpp
+++ b/modules/gui/qt/components/mediacenter/mcmedialib.cpp
@@ -101,7 +101,10 @@ void MCMediaLib::addToPlaylist(const MLParentId & itemId)
QVector<vlc::playlist::Media> medias;
std::transform(mediaRange.begin(), mediaRange.end(), std::back_inserter(medias), [&](vlc_ml_media_t& m) {
input_item_t* item = vlc_ml_get_input_item( m_ml, m.i_id );
- return vlc::playlist::Media(item);
+ auto res = vlc::playlist::Media(item);
+ if ( item )
+ input_item_Release( item );
+ return res;
});
m_intf->p_sys->p_mainPlaylistController->append(medias, false);
}
--
2.19.1
More information about the vlc-devel
mailing list