code: func (r *HandlerRegistry) Deregister(cname string) error {
  	chaincodeLogger.Debugf("deregister handler: %s", cname)
  
  	r.mutex.Lock()
  	handler := r.handlers[cname]
  	delete(r.handlers, cname)
  	delete(r.launching, cname)
  	r.mutex.Unlock()
  
  	if handler == nil {
  		return errors.Errorf("could not find handler: %s", cname)
  	}
  
  	handler.Close()
  
  	chaincodeLogger.Debugf("deregistered handler with key: %s", cname)
  	return nil
  }
docs: // Deregister clears references to state associated specified chaincode.
  // As part of the cleanup, it closes the handler so it can cleanup any state.
  // If the registry does not contain the provided handler, an error is returned.