From 2985d651933de49844a262c51178c527e8d7d81c Mon Sep 17 00:00:00 2001 From: TudbuT Date: Tue, 18 Jun 2024 18:48:20 +0200 Subject: [PATCH] eliminate a possibility for the loader to lock up --- .../baseband/launcher/classloader/CustomClassLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java index ed3a90b..aca37b5 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java @@ -134,6 +134,13 @@ public class CustomClassLoader extends ClassLoader implements Util { } } + @Override + public synchronized Class loadClass(String name) throws ClassNotFoundException { + synchronized (Launch.classLoader) { + return super.loadClass(name); + } + } + private Class loadBBClass(String name) { /*Set uniqueClassLoaders = Thread.getAllStackTraces().keySet().stream() .map(Thread::getContextClassLoader)