/** * @param gl * context to which the textures were bound. * */ public void cleanUp( GL gl ) { // should only be called after a render cycle. LOG.debug( "Cleaning up {} number of LRU marked textures from gpu. Cache currently holds: {} textures ", markedAsRemoved.size(), this.size() ); for ( FragmentTexture ft : markedAsRemoved ) { if ( ft != null ) { remove( ft.getId() ); if ( values().contains( ft ) ) { LOG.warn( "Although removed, the give texture ({}) is still in the cache, this is strange.", ft ); } ft.disable( gl ); ft.unload(); // remove( ft ); } } markedAsRemoved.clear(); LOG.debug( "After clean up, gpu cache still holds: {} textures ", this.size() ); }