[vlc-devel] commit: libvlc: Don't use input_ItemClean. Anyway when we leak an object there is no use to delete it in the end. The mistake has already been done. (Pierre d'Herbemont )
pdherbemont at free.fr
Mon Mar 31 19:58:38 CEST 2008
On Mar 31, 2008, at 6:26 AM, Rafaël Carré wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Le Mon, 31 Mar 2008 00:44:54 +0200 (CEST),
> git at videolan.org (git version control) a écrit :
>> vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org>
>> | Mon Mar 31 00:44:25 2008 +0200|
>> libvlc: Don't use input_ItemClean. Anyway when we leak an object
>> there is no use to delete it in the end. The mistake has already been
>> src/libvlc-common.c | 3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>> diff --git a/src/libvlc-common.c b/src/libvlc-common.c
>> index a0ba3cd..d4573c5 100644
>> --- a/src/libvlc-common.c
>> +++ b/src/libvlc-common.c
>> @@ -989,8 +989,7 @@ int libvlc_InternalCleanup( libvlc_int_t
>> *p_libvlc ) msg_Dbg( p_libvlc, "removing remaining input items" );
>> FOREACH_ARRAY( input_item_t *p_del, p_libvlc->input_items )
>> msg_Dbg( p_libvlc, "WARNING: %p input item has not been
>> deleted properly", p_del );
>> - input_ItemClean( p_del );
>> - free( p_del );
>> + /* Don't do anything, faulting code should be fixed */
>> ARRAY_RESET( p_libvlc->input_items );
> input items are not objects.
they are not vlc objects but they are gc enabled objects.
> Where are those supposed to be deleted, if not at libvlc destruction ?
The leaking input items are generally from the playlist which does not
properly delete them. I was a bit lazy to investigate more. But the
input item used by the playlist are supposed to freed by the playlist,
those used by libvlc-control are supposed to be released by libvlc-
control, same apply for input and vlm.
> To force code to be fixed, abort() is generally a very good idea.
Agreed. I just wanted not to be blamed for yet an other crash ;)
> Another thing, there is msg_Warn to display warnings.
Same here :)
More information about the vlc-devel