Commit b6c76ecf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Deprecate ugly and unsafe vlc_object_find_name()

psz_object_name can only be read from the thread calling module_need()
for the current object. As an alternative, module_need() would have to
be called before vlc_object_attach(), which would break var_CreateGet*.
parent 674d0076
......@@ -75,6 +75,9 @@ VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) );
__attribute__((deprecated))
#endif
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
#if defined (__GNUC__) && !defined __cplusplus
__attribute__((deprecated))
#endif
VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) );
VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
......
......@@ -477,6 +477,9 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this,
{
vlc_object_t *p_found;
/* Reading psz_object_name from a separate inhibits thread-safety.
* Use a libvlc address variable instead for that sort of things! */
msg_Warn( p_this, "%s(%s) is not safe!", __func__, psz_name );
/* If have the requested name ourselves, don't look further */
if( !(i_mode & FIND_STRICT)
&& p_this->psz_object_name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment