[vlc-devel] commit: libvlc: ref_count should only be accessed in the lock. (Pierre d' Herbemont )

git version control git at videolan.org
Tue Jun 9 06:24:59 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Fri Jun  5 19:43:43 2009 -0700| [df6cae660efdd762466d93366e080f0efaa58325] | committer: Pierre d'Herbemont 

libvlc: ref_count should only be accessed in the lock.

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

 src/control/core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/control/core.c b/src/control/core.c
index a083f5b..ececd0e 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -165,9 +165,8 @@ void libvlc_release( libvlc_instance_t *p_instance )
     vlc_mutex_t *lock = &p_instance->instance_lock;
     int refs;
 
-    assert( p_instance->ref_count > 0 );
-
     vlc_mutex_lock( lock );
+    assert( p_instance->ref_count > 0 );
     refs = --p_instance->ref_count;
     vlc_mutex_unlock( lock );
 




More information about the vlc-devel mailing list