Commit fa096e60 authored by Filippo Carone's avatar Filippo Carone

release method added

parent 7c1e2611
...@@ -36,6 +36,7 @@ public class MediaDescriptor ...@@ -36,6 +36,7 @@ public class MediaDescriptor
private LibVlcMediaDescriptor instance; private LibVlcMediaDescriptor instance;
private LibVlc libvlc; private LibVlc libvlc;
private LibVlcEventManager eventManager; private LibVlcEventManager eventManager;
private boolean released;
/** /**
* @param jvlc The jvlc instance to create the media descriptor for. * @param jvlc The jvlc instance to create the media descriptor for.
...@@ -79,7 +80,7 @@ public class MediaDescriptor ...@@ -79,7 +80,7 @@ public class MediaDescriptor
@Override @Override
protected void finalize() throws Throwable protected void finalize() throws Throwable
{ {
libvlc.libvlc_media_release(instance); release();
super.finalize(); super.finalize();
} }
...@@ -102,4 +103,19 @@ public class MediaDescriptor ...@@ -102,4 +103,19 @@ public class MediaDescriptor
{ {
return libvlc; return libvlc;
} }
/**
*
*/
public void release()
{
if (released)
{
return;
}
released = true;
libvlc.libvlc_media_release(instance);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment