AWTGLCanvas: Make sure we don't paint while destroying the canvas
This commit is contained in:
parent
c0248a7ee4
commit
216044ffa4
|
@ -191,9 +191,11 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
||||||
* @see java.awt.Component#removeNotify()
|
* @see java.awt.Component#removeNotify()
|
||||||
*/
|
*/
|
||||||
public void removeNotify() {
|
public void removeNotify() {
|
||||||
|
synchronized (SYNC_LOCK) {
|
||||||
destroyContext();
|
destroyContext();
|
||||||
super.removeNotify();
|
super.removeNotify();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set swap interval.
|
* Set swap interval.
|
||||||
|
@ -284,6 +286,8 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
|
||||||
*/
|
*/
|
||||||
public final void paint(Graphics g) {
|
public final void paint(Graphics g) {
|
||||||
synchronized (SYNC_LOCK) {
|
synchronized (SYNC_LOCK) {
|
||||||
|
if (!isDisplayable())
|
||||||
|
return;
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue