diff options
Diffstat (limited to 'src/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r-- | src/classes/com/sun/opengl/impl/GLContextImpl.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java index 5f945a334..795b06e9a 100644 --- a/src/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java @@ -150,7 +150,14 @@ public abstract class GLContextImpl extends GLContext { } } - destroyImpl(); + // Must hold the lock around the destroy operation to make sure we + // don't destroy the context out from under another thread rendering to it + lock.lock(); + try { + destroyImpl(); + } finally { + lock.unlock(); + } } protected abstract void destroyImpl() throws GLException; |