public void destroy(){
  context.removeVisualizationListener(this);
  context.removeResultListener(this);
  for (  Entry<VisualizationTask,Visualization> v : taskmap.entrySet()) {
    Visualization vis=v.getValue();
    if (vis != null) {
      vis.destroy();
    }
  }
  taskmap.clear();
}

public void destroy ( ) { context . removeVisualizationListener ( this ) ; context . removeResultListener ( this ) ; for ( Entry < VisualizationTask , Visualization > v : taskmap . entrySet ( ) ) { Visualization vis = v . getValue ( ) ; if ( vis != null ) { vis . destroy ( ) ; } } taskmap . clear ( ) ; }
cleanup function . to remove listeners .
