AWTGLCanvas: Synchronize paintGL() to avoid destroyContext while painting

This commit is contained in:
Elias Naur 2006-11-07 15:14:31 +00:00
parent 8164a4a00a
commit 9f3de4fd81
1 changed files with 32 additions and 30 deletions

View File

@ -283,6 +283,7 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
* be overridden to do GL operations.
*/
public final void paint(Graphics g) {
synchronized (SYNC_LOCK) {
try {
if (peer_info == null) {
this.peer_info = implementation.createPeerInfo(this, pixel_format);
@ -322,6 +323,7 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
throw new RuntimeException(e);
}
}
}
/**
* override update to avoid clearing