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()
|
protected void shutDown()
|
||||||
{
|
{
|
||||||
clientThread.invoke(() ->
|
clientThread.invoke(() ->
|
||||||
|
{
|
||||||
|
client.setGpu(false);
|
||||||
|
client.setDrawCallbacks(null);
|
||||||
|
|
||||||
|
if (gl != null)
|
||||||
{
|
{
|
||||||
if (textureArrayId != -1)
|
if (textureArrayId != -1)
|
||||||
{
|
{
|
||||||
@@ -326,9 +331,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
textureArrayId = -1;
|
textureArrayId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
client.setGpu(false);
|
|
||||||
client.setDrawCallbacks(null);
|
|
||||||
|
|
||||||
if (bufferId != -1)
|
if (bufferId != -1)
|
||||||
{
|
{
|
||||||
GLUtil.glDeleteBuffer(gl, bufferId);
|
GLUtil.glDeleteBuffer(gl, bufferId);
|
||||||
@@ -357,7 +359,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
}
|
}
|
||||||
|
|
||||||
glContext.destroy();
|
glContext.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jawtWindow != null)
|
||||||
|
{
|
||||||
NewtFactoryAWT.destroyNativeWindow(jawtWindow);
|
NewtFactoryAWT.destroyNativeWindow(jawtWindow);
|
||||||
|
}
|
||||||
|
|
||||||
jawtWindow = null;
|
jawtWindow = null;
|
||||||
gl = null;
|
gl = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user