[vlc-commits] input: invoke input_Destructor() directly

Rémi Denis-Courmont git at videolan.org
Sun Mar 17 11:25:22 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 16 10:39:54 2019 +0200| [7fdde9543e6e00de6288820146c9f706c5b2196d] | committer: Rémi Denis-Courmont

input: invoke input_Destructor() directly

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7fdde9543e6e00de6288820146c9f706c5b2196d
---

 src/input/input.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index c562ad04a3..536c6ef6ba 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -256,9 +256,8 @@ void input_SetPosition( input_thread_t *p_input, float f_position, bool b_fast )
 /**
  * Input destructor (called when the object's refcount reaches 0).
  */
-static void input_Destructor( vlc_object_t *obj )
+static void input_Destructor( input_thread_t *p_input )
 {
-    input_thread_t *p_input = (input_thread_t *)obj;
     input_thread_private_t *priv = input_priv(p_input);
 #ifndef NDEBUG
     char * psz_name = input_item_GetName( priv->p_item );
@@ -512,7 +511,6 @@ static input_thread_t *Create( vlc_object_t *p_parent,
     priv->p_es_out = NULL;
 
     /* Set the destructor when we are sure we are initialized */
-    vlc_object_set_destructor( p_input, input_Destructor );
     atomic_init(&priv->refs, 0);
     return p_input;
 }
@@ -533,6 +531,7 @@ void input_Release(input_thread_t *input)
         return;
 
     atomic_thread_fence(memory_order_acquire);
+    input_Destructor(input);
     vlc_object_delete(VLC_OBJECT(input));
 }
 



More information about the vlc-commits mailing list