From b29e49e609458f567ae8e434d7a498e02fac01e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Wed, 12 Dec 2007 17:05:55 +0000 Subject: [PATCH] module_Put: releases a reference to a module --- include/vlc_modules.h | 4 +++- src/libvlc.sym | 2 ++ src/modules/modules.c | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/vlc_modules.h b/include/vlc_modules.h index 68ced4dd0b..245bb1af7a 100644 --- a/include/vlc_modules.h +++ b/include/vlc_modules.h @@ -25,7 +25,7 @@ #error You are not libvlc or one of its plugins. You cannot include this file #endif -#if 1 +#if 0 /* FIXME: scheduled for privatization */ #define MODULE_SHORTCUT_MAX 50 @@ -107,6 +107,8 @@ VLC_EXPORT( vlc_bool_t, __module_Exists, ( vlc_object_t *, const char * ) ); /* Use only if you know what you're doing... */ #define module_FindName(a,b) __module_FindName(VLC_OBJECT(a),b) VLC_EXPORT( module_t *, __module_FindName, ( vlc_object_t *, const char * ) ); +VLC_EXPORT( void, module_Put, ( module_t *module ) ); + /* Return a NULL terminated array with the names of the modules that have a * certain capability. diff --git a/src/libvlc.sym b/src/libvlc.sym index 4e64b62434..9c25d22410 100644 --- a/src/libvlc.sym +++ b/src/libvlc.sym @@ -176,6 +176,8 @@ __intf_UserYesNo IsUTF8 LocaleFree mdate +__module_FindName +module_Put __module_Exists __module_Need __module_Unneed diff --git a/src/modules/modules.c b/src/modules/modules.c index 7da944e4c3..773ad01de5 100644 --- a/src/modules/modules.c +++ b/src/modules/modules.c @@ -709,6 +709,16 @@ module_t *__module_FindName( vlc_object_t *p_this, const char * psz_name ) return NULL; } + +/***************************************************************************** + * module_Put: release a module_t pointer from module_FindName(). + *****************************************************************************/ +void module_Put ( module_t *module ) +{ + vlc_object_release ( module ); +} + + /***************************************************************************** * module_Exists: tell if a module exists. ***************************************************************************** @@ -719,7 +729,7 @@ vlc_bool_t __module_Exists( vlc_object_t *p_this, const char * psz_name ) module_t *p_module = __module_FindName( p_this, psz_name ); if( p_module ) { - vlc_object_release( p_module ); + module_Put( p_module ); return VLC_TRUE; } else -- 2.39.2