Bug 997

Summary: Error on dispose
Product: [JogAmp] Jogl Reporter: Giuseppe Barbieri <elect86>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED INVALID    
Severity: major CC: sgothel
Priority: ---    
Version: 1   
Hardware: pc_x86_64   
OS: linux   
Type: --- SCM Refs:
Workaround: ---

Description Giuseppe Barbieri 2014-03-09 13:41:39 CET
Here a minimal test case

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.swing.JFrame;

/**
 *
 * @author elect
 */
public class Bug extends JFrame {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        bug = new Bug();
    }

    private static Bug bug;
    private GlViewer glViewer;

    public Bug() {

        glViewer = new GlViewer();

        add(glViewer.newtCanvasAWT);

        final Animator animator = new Animator(glViewer.glWindow);

        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent windowEvent) {

                animator.stop();
                System.exit(0);
            }
        });

        setSize(1024, 768);

        setVisible(true);

        animator.start();
    }

    private class GlViewer implements GLEventListener {

        public GLWindow glWindow;
        public NewtCanvasAWT newtCanvasAWT;
        public Animator animator;
        
        public GlViewer(){
            
            GLProfile glProfile = GLProfile.getDefault();

            GLCapabilities glCapabilities = new GLCapabilities(glProfile);

        glWindow = GLWindow.create(glCapabilities);
        
        glWindow.addGLEventListener(this);

        glWindow.setVisible(true);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);
        }
        
        @Override
        public void init(GLAutoDrawable glad) {
        }

        @Override
        public void dispose(GLAutoDrawable glad) {
        }

        @Override
        public void display(GLAutoDrawable glad) {
        }

        @Override
        public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
        }

    }
}


This is the error

X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 3/3, reusable (open, marked uncloseable): 0, pending (open in creation order): 3)
X11Util: Open X11 Display Connections: 3
X11Util: Open[0]: NamedX11Display[:0, 0x7f81540a1980, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0, 0x7f81540dbe90, refCount 1, unCloseable false]
X11Util: Open[2]: NamedX11Display[:0, 0x7f819c5f09a0, refCount 1, unCloseable false]
Comment 1 Sven Gothel 2014-03-10 18:21:36 CET
This is not an error, but a notification
that you have not closed the display / device properly.

The display is kept open, since you don't close the window,
here the GLWindow bound to the NewtCanvasAWT.
Comment 2 Giuseppe Barbieri 2014-03-10 18:29:06 CET
How do I close the windows? destroy() on the glWindow doesn't work either