Merge pull request #6485 from deathbeam/gpu-null-check
Null-check GL and window on plugin shutdown
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