[committed] Destroying headless display

Following step occurs error.

  1. create headdless display first.
  2. closing window.
  3. creating window using code below


if (display.isCreated()) {
   display.reset();
   display.recreateWindow(width, height, bpp, freq, full);
} else
   display.createWindow(width, height, bpp, freq, full);



It's because when closing headless window 'created' value isn't set to false

patch code


Index: src/com/jme/system/lwjgl/LWJGLDisplaySystem.java
===================================================================
--- src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (revision 4436)
+++ src/com/jme/system/lwjgl/LWJGLDisplaySystem.java   (working copy)
@@ -306,7 +306,13 @@
      * <code>close</code> destroys the LWJGL Display context.
      */
     public void close() {
-        Display.destroy();
+        if (headlessDisplay != null) {
+            headlessDisplay.destroy();
+            headlessDisplay = null;
+        } else {
+            Display.destroy();
+        }
+        created = false;
     }
 
     /**