Revert "Merge pull request #4568 from deathbeam/proper-shutdown"
This reverts commit8d53997685, reversing changes made to4f548e835c. This is crashing on shutdown.
This commit is contained in:
@@ -51,9 +51,4 @@ public interface GameEngine
|
|||||||
* @return true if on the main thread, false otherwise
|
* @return true if on the main thread, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isClientThread();
|
boolean isClientThread();
|
||||||
|
|
||||||
/**
|
|
||||||
* Shut downs all open connections and files in client and serializes not serialized data.
|
|
||||||
*/
|
|
||||||
void shutDown();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.io.File;
|
|||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.lang.management.RuntimeMXBean;
|
import java.lang.management.RuntimeMXBean;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Provider;
|
import javax.inject.Provider;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -112,9 +111,6 @@ public class RuneLite
|
|||||||
@Inject
|
@Inject
|
||||||
private OverlayManager overlayManager;
|
private OverlayManager overlayManager;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private ScheduledExecutorService executorService;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Provider<ItemManager> itemManager;
|
private Provider<ItemManager> itemManager;
|
||||||
|
|
||||||
@@ -296,10 +292,8 @@ public class RuneLite
|
|||||||
|
|
||||||
public void shutdown()
|
public void shutdown()
|
||||||
{
|
{
|
||||||
pluginManager.stopCorePlugins();
|
|
||||||
clientSessionManager.shutdown();
|
clientSessionManager.shutdown();
|
||||||
discordService.close();
|
discordService.close();
|
||||||
executorService.shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
@@ -214,23 +214,6 @@ public class PluginManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopCorePlugins()
|
|
||||||
{
|
|
||||||
List<Plugin> scannedPlugins = new ArrayList<>(plugins);
|
|
||||||
for (Plugin plugin : scannedPlugins)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
stopPlugin(plugin);
|
|
||||||
plugins.remove(plugin);
|
|
||||||
}
|
|
||||||
catch (PluginInstantiationException ex)
|
|
||||||
{
|
|
||||||
log.warn("Unable to stop plugin {}. {}", plugin.getClass().getSimpleName(), ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Plugin> scanAndInstantiate(ClassLoader classLoader, String packageName) throws IOException
|
List<Plugin> scanAndInstantiate(ClassLoader classLoader, String packageName) throws IOException
|
||||||
{
|
{
|
||||||
MutableGraph<Class<? extends Plugin>> graph = GraphBuilder
|
MutableGraph<Class<? extends Plugin>> graph = GraphBuilder
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import java.awt.Graphics;
|
|||||||
import java.awt.GraphicsConfiguration;
|
import java.awt.GraphicsConfiguration;
|
||||||
import java.awt.LayoutManager;
|
import java.awt.LayoutManager;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.SystemTray;
|
|
||||||
import java.awt.TrayIcon;
|
import java.awt.TrayIcon;
|
||||||
import java.awt.event.InputEvent;
|
import java.awt.event.InputEvent;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
@@ -272,21 +271,6 @@ public class ClientUI
|
|||||||
{
|
{
|
||||||
saveClientBoundsConfig();
|
saveClientBoundsConfig();
|
||||||
runelite.shutdown();
|
runelite.shutdown();
|
||||||
|
|
||||||
if (SystemTray.isSupported())
|
|
||||||
{
|
|
||||||
SystemTray.getSystemTray().remove(trayIcon);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (client != null)
|
|
||||||
{
|
|
||||||
client.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (client instanceof Client)
|
|
||||||
{
|
|
||||||
((Client)client).shutDown();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
this::showWarningOnExit
|
this::showWarningOnExit
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,7 +32,4 @@ public interface RSGameEngine extends GameEngine
|
|||||||
{
|
{
|
||||||
@Import("canvas")
|
@Import("canvas")
|
||||||
Canvas getCanvas();
|
Canvas getCanvas();
|
||||||
|
|
||||||
@Import("shutDown")
|
|
||||||
void shutDown();
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user