]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
libvlc: Abort in case of unhandled exception.
[vlc] / src / control / core.c
index 7a062211f36e6ce824609a03fc414edb77b95aba..4a258d26b686fe3448a20dd33d81216ea1075358 100644 (file)
@@ -25,6 +25,7 @@
 #include <vlc/libvlc.h>
 
 #include <vlc_interface.h>
+#include <vlc_vlm.h>
 
 #include <stdarg.h>
 #include <limits.h>
@@ -70,6 +71,7 @@ static void libvlc_exception_not_handled( const char *psz )
 {
     fprintf( stderr, "*** LibVLC Exception not handled: %s\nSet a breakpoint in '%s' to debug.\n",
              psz, __func__ );
+    abort();
 }
 
 void libvlc_exception_raise( libvlc_exception_t *p_exception,
@@ -164,9 +166,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 );