libvlc: ref_count should only be accessed in the lock.
authorPierre d'Herbemont <pdherbemont@free.fr>
Sat, 6 Jun 2009 02:43:43 +0000 (19:43 -0700)
committerPierre d'Herbemont <pdherbemont@free.fr>
Tue, 9 Jun 2009 04:24:02 +0000 (21:24 -0700)
src/control/core.c

index a083f5b..ececd0e 100644 (file)
@@ -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 );