]> git.sesse.net Git - vlc/blobdiff - bindings/java/src/core-jni.cc
fix dependancies
[vlc] / bindings / java / src / core-jni.cc
index 6f103aaf94863ebe8703c43a3b14c406d643a90f..03724642af2481cb6a80d0711abfadff22bec06d 100644 (file)
@@ -54,9 +54,9 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_JVLC_createInstance (JNIEnv *env,
     int argc;
     const char **argv;
 
-    libvlc_exception_t *exception = ( libvlc_exception_t * ) malloc( sizeof( libvlc_exception_t ) );
+    libvlc_exception_t exception;
 
-    libvlc_exception_init( exception );
+    libvlc_exception_init( &exception );
   
     argc = (int) env->GetArrayLength((jarray) args);
     argv = (const char **) malloc(argc * sizeof(char*));
@@ -67,9 +67,9 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_JVLC_createInstance (JNIEnv *env,
         );
     }
 
-    res = (long) libvlc_new(argc, (char**) argv, exception );
-
-    free( exception );
+    res = (long) libvlc_new(argc, (char**) argv, &exception );
+    CHECK_EXCEPTION ;
 
     return res;
 
@@ -81,7 +81,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLC__1destroy (JNIEnv *env, jobje
     
     instance = getClassInstance( env, _this );
 
-    libvlc_destroy( (libvlc_instance_t *) instance, NULL);
+    libvlc_release( (libvlc_instance_t *) instance );
 
     return;
 }