removing arbitrary GLEventListener

is there a way to remove a GLEventListener if the reference is unknown? from looking at the jogl source code i can tell that there is no way to do so.


  public synchronized void addGLEventListener(GLEventListener listener) {
    List newListeners = (List) ((ArrayList) listeners).clone();
    newListeners.add(listener);
    listeners = newListeners;
  }
  
  public synchronized void removeGLEventListener(GLEventListener listener) {
    List newListeners = (List) ((ArrayList) listeners).clone();
    newListeners.remove(listener);
    listeners = newListeners;
  }

i just ran into a situation where i had a reference to a GLCanvas but not to the added GLEventListener. wouldn t it be cool to be able to poll those listeners? i know that i could always add this myself and recompile :wink:

If you could write up a concrete example of why you need this and file an RFE on the JOGL Issue Tracker we’ll consider adding it to the next release. Recall that you get a new reference to your GLEventListener on every display() callback; it’s the “this” pointer.