code: func (na *cnmNetworkAllocator) Deallocate(n *api.Network) error {
  	localNet := na.getNetwork(n.ID)
  	if localNet == nil {
  		return fmt.Errorf("could not get networker state for network %s", n.ID)
  	}
  
  	// No swarm-level resource deallocation needed for node-local networks
  	if localNet.isNodeLocal {
  		delete(na.networks, n.ID)
  		return nil
  	}
  
  	if err := na.freeDriverState(n); err != nil {
  		return errors.Wrapf(err, "failed to free driver state for network %s", n.ID)
  	}
  
  	delete(na.networks, n.ID)
  
  	return na.freePools(n, localNet.pools)
  }
docs: // Deallocate frees all the general and driver specific resources
  // which were assigned to the passed network.