Login  Register

Re: Incomplete shutdown (Eclipse)

Posted by adi on Aug 21, 2014; 9:53pm
URL: https://forum.jogamp.org/Incomplete-shutdown-Eclipse-tp4025154p4032878.html

Hi

Something it take a bit time with big datas. I had never problems with that in jogl.
Perhaps this code can help a bit:


/* This stop() method is for a clean shutdown
  * for the display.Gives back Listener and
  * stops a running Animator
  * see @ com.jogamp.opengl.util.Animator
  */
public void stop( final String error, final Animator anim )
 {

  // Run this on another thread than the AWT event queue to
  // make sure the call to Animator.stop() completes before exiting
     new Thread( new Runnable()
       {
         public void run()
           {
             if ( anim!=null )
              anim.stop();
             

             /* win is created with
                 final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(display, 0);
                 scrn.addReference();
                 win = GLWindow.create(scrn, glCaps);
             */
             if ( win!=null )
              {

                //remove the listener
                removeKeyListener();
                removeMouseListener();
              }
             win.getScreen().removeReference();
             System.exit(0);
             if ( error!=null && error.length()>0 )
              Log.getLogger().log(Level.SEVERE , error );
            }
          }).start();
       }