- module_unneed( p_playlist , p_module );
- i_ret = VLC_SUCCESS;
- }
-
- /* Clean up */
- fclose( p_export->p_file );
- free( p_export->psz_filename );
- free( p_export );
- p_playlist->p_private = NULL;
- vlc_object_unlock( p_playlist );
-
- return i_ret;
+ module_t *p_module;
+
+ /* And call the module ! All work is done now */
+ playlist_Lock( p_playlist );
+ p_module = module_need( p_export, "playlist export", psz_type, true );
+ playlist_Unlock( p_playlist );
+
+ if( p_module == NULL )
+ msg_Err( p_playlist, "could not export playlist" );
+ else
+ {
+ module_unneed( p_export, p_module );
+ ret = VLC_SUCCESS;
+ }
+ fclose( p_export->p_file );
+ }
+ vlc_object_release( p_export );
+ return ret;