[libbluray-devel] Fix JVM shutdown when bdj_open() and bdj_close() are called from different threads

hpi1 git at videolan.org
Sat May 11 08:47:06 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat May 11 09:42:02 2013 +0300| [8c321835c590de8ff413a9d1ee30dd838e715451] | committer: hpi1

Fix JVM shutdown when bdj_open() and bdj_close() are called from different threads

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8c321835c590de8ff413a9d1ee30dd838e715451
---

 src/libbluray/bdj/bdj.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 837b24d..281b69c 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -346,6 +346,9 @@ BDJAVA* bdj_open(const char *path, struct bluray *bd,
         return NULL;
     }
 
+    /* detach java main thread (CreateJavaVM attachs calling thread to JVM) */
+    (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm);
+
     return bdjava;
 }
 



More information about the libbluray-devel mailing list