From: Pierre d'Herbemont Date: Tue, 26 Feb 2008 01:37:34 +0000 (+0000) Subject: src/playlist: Fix a rare memleak that could happen when the interaction is created... X-Git-Tag: 0.9.0-test0~2479 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=28a41153e77335041ff45992e92e49f354b6f780;p=vlc src/playlist: Fix a rare memleak that could happen when the interaction is created earlier than expected. (Fix vlc_object mem leak that happen when no module is loaded). --- diff --git a/src/playlist/engine.c b/src/playlist/engine.c index 05858a80a1..e3af6b8f9c 100644 --- a/src/playlist/engine.c +++ b/src/playlist/engine.c @@ -150,6 +150,12 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) p_playlist->i_sort = SORT_ID; p_playlist->i_order = ORDER_NORMAL; + + /* Interaction + * Init the interaction here, as playlist_MLLoad could trigger + * interaction init */ + p_playlist->p_interaction = NULL; + b_save = p_playlist->b_auto_preparse; p_playlist->b_auto_preparse = VLC_FALSE; playlist_MLLoad( p_playlist ); diff --git a/src/playlist/thread.c b/src/playlist/thread.c index caadd8cdcf..fa6534074f 100644 --- a/src/playlist/thread.c +++ b/src/playlist/thread.c @@ -65,9 +65,6 @@ void __playlist_ThreadCreate( vlc_object_t *p_parent ) vlc_mutex_init( p_playlist, &p_playlist->p_stats->lock ); p_playlist->p_stats_computer = NULL; - // Interaction - p_playlist->p_interaction = NULL; - // Preparse p_playlist->p_preparse = vlc_object_create( p_playlist, sizeof( playlist_preparse_t ) );