Null-check GL and window on plugin shutdown
If GL is not even created due to missing library error or unsupported version, this throws a lot of unnecessary exceptions to log and fails on shutDown resulting in possibly improperly feed objects and displays. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -319,6 +319,11 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
protected void shutDown()
|
||||
{
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
client.setGpu(false);
|
||||
client.setDrawCallbacks(null);
|
||||
|
||||
if (gl != null)
|
||||
{
|
||||
if (textureArrayId != -1)
|
||||
{
|
||||
@@ -326,9 +331,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
textureArrayId = -1;
|
||||
}
|
||||
|
||||
client.setGpu(false);
|
||||
client.setDrawCallbacks(null);
|
||||
|
||||
if (bufferId != -1)
|
||||
{
|
||||
GLUtil.glDeleteBuffer(gl, bufferId);
|
||||
@@ -357,7 +359,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
}
|
||||
|
||||
glContext.destroy();
|
||||
}
|
||||
|
||||
if (jawtWindow != null)
|
||||
{
|
||||
NewtFactoryAWT.destroyNativeWindow(jawtWindow);
|
||||
}
|
||||
|
||||
jawtWindow = null;
|
||||
gl = null;
|
||||
|
||||
Reference in New Issue
Block a user