[libbluray-devel] Close the class loader when releasing the BDJXletContext.

ace20022 git at videolan.org
Wed Nov 12 09:49:15 CET 2014


libbluray | branch: master | ace20022 <ace20022 at ymail.com> | Tue Nov 11 21:55:02 2014 +0100| [1536f3b69dad57cec1a8c655e95e720ed71e3709] | committer: hpi1

Close the class loader when releasing the BDJXletContext.

This fixes non-erasable cached jar files due to opened handles.

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

 src/libbluray/bdj/java/org/videolan/BDJXletContext.java |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
index 7f6f757..80351d5 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
@@ -21,6 +21,8 @@ package org.videolan;
 
 import java.awt.Container;
 import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.LinkedList;
 import java.util.HashMap;
@@ -430,6 +432,16 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
 
         threadGroup.stopAll(1000);
 
+        try {
+            Method m;
+            m = loader.getClass().getMethod("close", new Class[0]);
+            m.invoke(loader, new Object[0]);
+        } catch (NoSuchMethodException e) {
+        } catch (IllegalAccessException e) {
+        } catch (IllegalArgumentException e) {
+        } catch (InvocationTargetException e) {
+        }
+
         synchronized (this) {
             threadGroup = null;
             loader = null;



More information about the libbluray-devel mailing list