// Deallocate this object
192271
func (o *PooledObject) Deallocate() bool {
	o.lock.Lock()
	result := o.doDeallocate()
	o.lock.Unlock()
	return result
}
1200740
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)
}
398909
func (ic *IngressIPController) deallocate(service *v1.Service, key string) error {
	klog.V(5).Infof("Clearing allocation state for %v", key)

	// Make a copy to modify to avoid mutating cache state
	serviceCopy := service.DeepCopy()

	// Get the ingress ip to remove from local allocation state before
	// it is removed from the service.
	ipString := serviceCopy.Status.LoadBalancer.Ingress[0].IP

	if err := ic.clearPersistedAllocation(serviceCopy, key, ""); err != nil {
		return err
	}

	ic.clearLocalAllocation(key, ipString)
	return nil
}
286960
func (l *LocalStore) Delete(ctx context.Context, obj string) error {
	fo := path.Join(l.storepath, obj)
	os.Remove(fo)
	mf := fo + ".metadata"
	if cloudstorage.Exists(mf) {
		os.Remove(mf)
	}
	return nil
}
1167581
func (n *NomadAgent) Destroy() error {
	if err := n.Stop(); err != nil {
		return err
	}
	return os.RemoveAll(n.DataDir)
}
93427
func (ptree *ptree) Dispose() {
	if atomic.LoadUint64(&ptree.disposed) == 1 {
		return
	}
	ptree.actions.Dispose()
	atomic.StoreUint64(&ptree.disposed, 1)
	close(ptree.disposeChannel)
}
951572
func (m *SecureMap) Remove(key interface{}) {
	m.lock.Lock()
	delete(m.data, key)
	m.lock.Unlock()
}
1249668
func (b *Bulk) Remove(selectors ...interface{}) {
	action := b.action(bulkRemove)
	for _, selector := range selectors {
		if selector == nil {
			selector = bson.D{}
		}
		action.docs = append(action.docs, &deleteOp{
			Collection: b.c.FullName,
			Selector:   selector,
			Flags:      1,
			Limit:      1,
		})
	}
}
416724
func (s *storeImpl) Delete(key string) {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	delete(s.objects, key)
}
820966
func (ref *Reference) Release() {
	ref.once.Do(func() {
		live.untrack(ref)
		ref.wg.Done()
	})
}
781409
func (g *GcsFS) Delete(ctx context.Context, obj string) error {
	err := g.gcsb().Object(obj).Delete(ctx)
	if err != nil {
		return err
	}
	return nil
}
464632
func (rm *StateResourceManager) DeallocateResourceVal(id, desc string,
	value interface{}) error {
	// XXX: need to take care of distibuted updates, locks etc here
	rsrc, alreadyExists, err := rm.findResource(id, desc)
	if err != nil {
		return err
	}

	if !alreadyExists {
		return core.Errorf("No resource found for description: %q and id: %q",
			desc, id)
	}

	return rsrc.Deallocate(value)
}
635566
func (a *StorageAPIv3) Destroy(args params.Entities) (params.ErrorResults, error) {
	v4Args := params.RemoveStorage{
		Storage: make([]params.RemoveStorageInstance, len(args.Entities)),
	}
	for i, arg := range args.Entities {
		v4Args.Storage[i] = params.RemoveStorageInstance{
			Tag: arg.Tag,
			// The v3 behaviour was to detach the storage
			// at the same time as marking the storage Dying.
			DestroyAttachments: true,
			DestroyStorage:     true,
		}
	}
	return a.remove(v4Args)
}
1300538
func (s *Session) Remove(key string) error {
	s.Lock()
	defer s.Unlock()

	delete(s.data, key)
	return s.updateEncodedData()
}
48782
func (c *Client) Delete(object Object) error {
	className, err := objectTypeName(object)
	if err != nil {
		return err
	}
	uri := fmt.Sprintf("/1/classes/%s/%s", className, object.ObjectID())
	resp, err := c.doSimple("DELETE", uri)
	defer resp.Body.Close()
	c.trace("Delete", uri)
	return err
}
574660
func (s *redisStorage) Delete(key string) error {
	cmd := s.c.Del(key)
	return cmd.Err()
}
1179194
func (s *Store) Remove(i interface{}) error {
	location := s.Path(i)
	return os.Remove(location)
}