]> git.sesse.net Git - vlc/commit
libvlc: media: fix leak if it has subitems
authorThomas Guillem <thomas@gllm.fr>
Tue, 20 Jan 2015 09:46:29 +0000 (10:46 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 20 Jan 2015 10:20:27 +0000 (11:20 +0100)
commit16565d4c0449d9a2cd132c20578a18145b31af60
treea72a5a19c62bf00b585ac1d61fa6e09d85da16f9
parent4bc33dbc16a4dc749c006a58ddb8701d1a146ec9
libvlc: media: fix leak if it has subitems

Don't call libvlc_media_list_set_media from media since it causes
p_md->p_subitems to retain p_md while p_md is already retaining
p_md->p_subitems, therefore these 2 objects won't be releasable.

Add a new internal variable: p_internal_md that is set from media without
retaining it.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
lib/media.c
lib/media_list.c
lib/media_list_internal.h