Commit d19241aedb19e662bb46af9e28eee499e0c46215

Authored by Mumfrey
1 parent 35d59a00

close HandlerList's ClassLoader on Java 7 and later.

java/common/com/mumfrey/liteloader/core/event/HandlerList.java
1 package com.mumfrey.liteloader.core.event; 1 package com.mumfrey.liteloader.core.event;
2 2
  3 +import java.io.Closeable;
3 import java.io.IOException; 4 import java.io.IOException;
4 import java.lang.reflect.Constructor; 5 import java.lang.reflect.Constructor;
5 import java.net.URL; 6 import java.net.URL;
@@ -165,6 +166,14 @@ public class HandlerList<T> extends LinkedList<T> implements FastIterableDeque<T @@ -165,6 +166,14 @@ public class HandlerList<T> extends LinkedList<T> implements FastIterableDeque<T
165 { 166 {
166 HandlerListClassLoader<T> classLoader = new HandlerListClassLoader<T>(this.type, this.logicOp); 167 HandlerListClassLoader<T> classLoader = new HandlerListClassLoader<T>(this.type, this.logicOp);
167 this.bakedHandler = classLoader.newHandler(this); 168 this.bakedHandler = classLoader.newHandler(this);
  169 + if (classLoader instanceof Closeable)
  170 + {
  171 + try
  172 + {
  173 + ((Closeable)classLoader).close();
  174 + }
  175 + catch (IOException ex) {}
  176 + }
168 } 177 }
169 178
170 /** 179 /**