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*));
);
}
- res = (long) libvlc_new(argc, (char**) argv, exception );
-
- free( exception );
+ res = (long) libvlc_new(argc, (char**) argv, &exception );
+
+ CHECK_EXCEPTION ;
return res;
instance = getClassInstance( env, _this );
- libvlc_destroy( (libvlc_instance_t *) instance, NULL);
+ libvlc_release( (libvlc_instance_t *) instance );
return;
}