AWTGLCanvas: Synchronize paintGL() to avoid destroyContext while painting
This commit is contained in:
parent
8164a4a00a
commit
9f3de4fd81
|
@ -283,6 +283,7 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
||||||
* be overridden to do GL operations.
|
* be overridden to do GL operations.
|
||||||
*/
|
*/
|
||||||
public final void paint(Graphics g) {
|
public final void paint(Graphics g) {
|
||||||
|
synchronized (SYNC_LOCK) {
|
||||||
try {
|
try {
|
||||||
if (peer_info == null) {
|
if (peer_info == null) {
|
||||||
this.peer_info = implementation.createPeerInfo(this, pixel_format);
|
this.peer_info = implementation.createPeerInfo(this, pixel_format);
|
||||||
|
@ -322,6 +323,7 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* override update to avoid clearing
|
* override update to avoid clearing
|
||||||
|
|
Loading…
Reference in New Issue