From ce6bd7e3f467e141175880357d3fc0786407ff7a Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Fri, 23 Nov 2018 13:30:46 +0000 Subject: [PATCH] Properly close GL context and lock surface - Context can be created without GL being assigned (e.g in case version is not supported) - We need to lock jawtWindow if it is not locked always in case it is not null, and not only when GL is set Signed-off-by: Tomas Slusny --- .../net/runelite/client/plugins/gpu/GpuPlugin.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index e5dd9e717f..1ea3c5d514 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -368,17 +368,20 @@ public class GpuPlugin extends Plugin implements DrawCallbacks shutdownProgram(); shutdownVao(); shutdownStretchedFbo(); + } + if (jawtWindow != null) + { if (!jawtWindow.getLock().isLocked()) { jawtWindow.lockSurface(); } - glContext.destroy(); - } + if (glContext != null) + { + glContext.destroy(); + } - if (jawtWindow != null) - { NewtFactoryAWT.destroyNativeWindow(jawtWindow); }