eliminate a possibility for the loader to lock up
All checks were successful
/ Build BaseBand Loader (push) Successful in 1m17s

This commit is contained in:
Daniella / Tove 2024-06-18 17:31:21 +02:00
parent 3f18de7575
commit d7422420e0
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -119,16 +119,18 @@ public class CustomClassLoader extends ClassLoader implements Util {
}
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (names.contains(name.replace('.', '/') + ".class")) {
Class<?> clazz = loadBBClass(name);
if(clazz != null)
return clazz;
}
try {
return Launch.classLoader.findClass(name);
} catch (ClassNotFoundException e) {
return super.findClass(name);
protected synchronized Class<?> findClass(String name) throws ClassNotFoundException {
synchronized (Launch.classLoader) {
if (names.contains(name.replace('.', '/') + ".class")) {
Class<?> clazz = loadBBClass(name);
if (clazz != null)
return clazz;
}
try {
return Launch.classLoader.findClass(name);
} catch (ClassNotFoundException e) {
return super.findClass(name);
}
}
}