code: protected void shutdown() {
  
  		stop();
  
  		if (webcams == null)
  			return;
  
  		// dispose all webcams
  
  		Iterator<Webcam> wi = webcams.iterator();
  		while (wi.hasNext()) {
  			Webcam webcam = wi.next();
  			webcam.dispose();
  		}
  
  		synchronized (Webcam.class) {
  
  			// clear webcams list
  
  			webcams.clear();
  
  			// unassign webcams from deallocator
  
  			if (Webcam.isHandleTermSignal()) {
  				WebcamDeallocator.unstore();
  			}
  		}
  	}
docs: Cleanup.