mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fix up other exit points. Should stop process hangs for clean exits.
This commit is contained in:
1 parent
90ad27d985
commit
3dbe6ccded
1 file changed
+5
-3
@@ -16,9 +16,11 @@ public class FMLSecurityManager extends SecurityManager {
|
||||
String permName = perm.getName() != null ? perm.getName() : "missing";
|
||||
if (permName.startsWith("exitVM"))
|
||||
{
|
||||
String callingClass = getClassContext()[4].getName();
|
||||
// FML is allowed to call system exit
|
||||
if (!callingClass.startsWith("cpw.mods.fml."))
|
||||
Class<?>[] classContexts = getClassContext();
|
||||
String callingClass = classContexts.length > 3 ? classContexts[4].getName() : "none";
|
||||
String callingParent = classContexts.length > 4 ? classContexts[5].getName() : "none";
|
||||
// FML is allowed to call system exit and the Minecraft applet (from the quit button)
|
||||
if (!(callingClass.startsWith("cpw.mods.fml.") || ( "net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) || ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent))))
|
||||
{
|
||||
throw new ExitTrappedException();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user