[vlc-devel] commit: Serialize vlc_object_set_destructor() against vlc_object_release() ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Mar 6 22:06:56 CET 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar  6 22:46:58 2009 +0200| [294e386ef465a0ad4b8c70c002951dbaeb351a06] | committer: Rémi Denis-Courmont 

Serialize vlc_object_set_destructor() against vlc_object_release()
(cherry picked from commit 6fa0eee4ac918fd9b586cfc6be4cd47e301ef9b1)

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index e522d52..3a9d53d 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -279,7 +279,10 @@ void __vlc_object_set_destructor( vlc_object_t *p_this,
                                   vlc_destructor_t pf_destructor )
 {
     vlc_object_internals_t *p_priv = vlc_internals(p_this );
+
+    vlc_spin_lock( &p_priv->ref_spin );
     p_priv->pf_destructor = pf_destructor;
+    vlc_spin_unlock( &p_priv->ref_spin );
 }
 
 /**




More information about the vlc-devel mailing list