public void dispose(GLAutoDrawable gLDrawable) {
        try {
            if (animator.isAnimating())
                animator.stop();
            
            Thread ani = animator.getThread(); 
            if (ani != null)
                ani.join();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }