AWTGLCanvas: Make sure we don't paint while destroying the canvas
This commit is contained in:
parent
c0248a7ee4
commit
216044ffa4
|
@ -191,8 +191,10 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
|||
* @see java.awt.Component#removeNotify()
|
||||
*/
|
||||
public void removeNotify() {
|
||||
destroyContext();
|
||||
super.removeNotify();
|
||||
synchronized (SYNC_LOCK) {
|
||||
destroyContext();
|
||||
super.removeNotify();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -284,6 +286,8 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
|||
*/
|
||||
public final void paint(Graphics g) {
|
||||
synchronized (SYNC_LOCK) {
|
||||
if (!isDisplayable())
|
||||
return;
|
||||
try {
|
||||
if (peer_info == null) {
|
||||
this.peer_info = implementation.createPeerInfo(this, pixel_format);
|
||||
|
|
Loading…
Reference in New Issue