mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 22:32:04 +00:00
Fix thread switch
This commit is contained in:
@@ -168,14 +168,13 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
engine = IrisWorlds.access(world.realWorld()).getCompound().getEngine(index);
|
engine = IrisWorlds.access(world.realWorld()).getCompound().getEngine(index);
|
||||||
|
return !engine.isClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Throwable e)
|
catch(Throwable e)
|
||||||
{
|
{
|
||||||
engine = IrisWorlds.access(world.realWorld()).getCompound().getDefaultEngine();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class EngineTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
parallaxBurster.shutdownAndAwait();
|
parallaxBurster.shutdownLater();
|
||||||
burster.shutdownAndAwait();
|
burster.shutdownLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package com.volmit.iris.engine.parallel;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
|
import com.volmit.iris.util.scheduling.J;
|
||||||
|
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
@@ -96,6 +97,10 @@ public class MultiBurst {
|
|||||||
service.shutdown();
|
service.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shutdownLater() {
|
||||||
|
J.a(service::shutdown, 100);
|
||||||
|
}
|
||||||
|
|
||||||
public void shutdownAndAwait() {
|
public void shutdownAndAwait() {
|
||||||
service.shutdown();
|
service.shutdown();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user