[vlc-devel] commit: objects: Send a vlc_object_kill from vlc_object_destroy() to make sure vlc_object_release() can properly free all the allocated resources when the refcount reach zero . (Pierre d'Herbemont )

git version control git at videolan.org
Sun Mar 23 01:16:22 CET 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Mar 23 00:51:03 2008 +0100| [f0fbb2b3eeb132bf961902f156e31431d43a6938]

objects: Send a vlc_object_kill from vlc_object_destroy() to make sure vlc_object_release() can properly free all the allocated resources when the refcount reach zero.

Previously you need to send a vlc_object_kill() prior to a vlc_object_release() to get your object actually destroyed, which rendered the refcounting unusuable in some cases.

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

 src/misc/objects.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index fa1bfe0..5e68e89 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -415,6 +415,10 @@ static void vlc_object_destroy( vlc_object_t *p_this )
         abort();
     }
 
+
+    /* Send a kill to the object's thread if applicable */
+    vlc_object_kill( p_this );
+
     /* Call the custom "subclass" destructor */
     if( p_priv->pf_destructor )
         p_priv->pf_destructor( p_this );




More information about the vlc-devel mailing list