summaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLJPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/jogl/GLJPanel.java')
-rw-r--r--src/net/java/games/jogl/GLJPanel.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java
index 155aca639..8b0c9f383 100644
--- a/src/net/java/games/jogl/GLJPanel.java
+++ b/src/net/java/games/jogl/GLJPanel.java
@@ -230,7 +230,13 @@ public final class GLJPanel extends JPanel implements GLDrawable {
if (!hardwareAccelerationDisabled) {
if (fwidth > pbufferWidth || fheight > pbufferHeight) {
// Must destroy and recreate pbuffer to fit
- pbuffer.destroy();
+ if (pbuffer != null) {
+ pbuffer.destroy();
+ }
+ if (toplevel != null) {
+ toplevel.dispose();
+ }
+ isInitialized = false;
if (fwidth > pbufferWidth) {
pbufferWidth = getNextPowerOf2(fwidth);
}