Fix up other exit points. Should stop process hangs for clean exits.
This commit is contained in:
parent
90ad27d985
commit
3dbe6ccded
1 changed files with 5 additions and 3 deletions
|
@ -16,9 +16,11 @@ public class FMLSecurityManager extends SecurityManager {
|
||||||
String permName = perm.getName() != null ? perm.getName() : "missing";
|
String permName = perm.getName() != null ? perm.getName() : "missing";
|
||||||
if (permName.startsWith("exitVM"))
|
if (permName.startsWith("exitVM"))
|
||||||
{
|
{
|
||||||
String callingClass = getClassContext()[4].getName();
|
Class<?>[] classContexts = getClassContext();
|
||||||
// FML is allowed to call system exit
|
String callingClass = classContexts.length > 3 ? classContexts[4].getName() : "none";
|
||||||
if (!callingClass.startsWith("cpw.mods.fml."))
|
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();
|
throw new ExitTrappedException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue