Fixed class loader not closing when deleting mods

This commit is contained in:
Anuken
2024-11-04 10:51:10 -05:00
parent fac26032aa
commit 9e2350be03
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package mindustry.mod;
import java.net.*;
public class ClassLoaderCloser{
/** Workaround for the close() method not being available on Android. */
public static void close(ClassLoader loader) throws Exception{
if(loader instanceof URLClassLoader u){
u.close();
}
}
}