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 <slusnucky@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user