// Remove an event listener channel by name. This will find the first
// listener in the list with the specified name and will remove it.
196887
func (state *ServicesState) RemoveListener(name string) error {
	state.Lock()
	defer state.Unlock()

	if _, ok := state.listeners[name]; ok {
		delete(state.listeners, name)
		log.Debugf("RemoveListener(): removed %s, new count %d", name, len(state.listeners))
		return nil
	}

	return fmt.Errorf("No listener found with the name: %s", name)
}
412206
func (e *events) Delete(name string) error {
	return e.client.Delete().
		NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
		Resource("events").
		Name(name).
		Do().
		Error()
}
1317858
func (r *RemoteObject) RemoveChangeChannel(channel chan struct{}) {
	r.mutex.Lock()
	if r.changedChannels[channel] != false {
		delete(r.changedChannels, channel)
		close(channel)
	}
	r.mutex.Unlock()
}
1172515
func (f *ListenerStack) Clear() {
	f.lock.Lock()
	f.listeners = f.listeners[0:0]
	f.lock.Unlock()
}
1370166
func (m *ChannelMap) Name() (string, error) {
	cstr := C.pa_channel_map_to_name(m.toC())
	if cstr == nil {
		return "", errors.New("No name found for channel mapping.")
	}
	return C.GoString(cstr), nil
}
77918
func (p *Loader) RemoveListener(id string) {
	p.Lock()
	delete(p.listeners, id)
	p.Unlock()
}
6457
func (b *UpdateBuilder) RemoveNamed(column, name string) *UpdateBuilder {
	return b.removeValue(column, param(name))
}
1045172
func (db *Database) Unlisten(channel string) error {
	if db.listener == nil {
		return errors.New("You must create a new listener first, calling Listen(channel)")
	}

	if channel == "*" {
		return db.listener.UnlistenAll()
	}
	return db.listener.Unlisten(channel)
}
1247688
func (sim *simra) RemoveAllCollisionListener() {
	simlog.FuncIn()
	sim.comap = nil
	simlog.FuncOut()
}
267052
func (c *ServiceConfigs) Remove(name string) {
	c.mu.Lock()
	delete(c.m, name)
	c.mu.Unlock()
}
1259899
func Remove(name string) error {
	lock.Lock()
	defer lock.Unlock()

	name = applyNamespace(name)

	delete(griftList, name)
	delete(descriptions, name)
	return nil
}
541797
func (s *XDSServer) RemoveListener(name string, wg *completion.WaitGroup) xds.AckingResourceMutatorRevertFunc {
	log.Debugf("Envoy: removeListener %s", name)

	var listenerRevertFunc func(*completion.Completion)

	s.mutex.Lock()
	listener, ok := s.listeners[name]
	if ok && listener != nil {
		listener.count--
		if listener.count == 0 {
			delete(s.listeners, name)
			listenerRevertFunc = s.listenerMutator.Delete(ListenerTypeURL, name, []string{"127.0.0.1"}, wg.AddCompletion())
		}
	} else {
		// Bail out if this listener does not exist
		log.Fatalf("Envoy: Attempt to remove non-existent listener: %s", name)
	}
	s.mutex.Unlock()

	return func(completion *completion.Completion) {
		s.mutex.Lock()
		if listenerRevertFunc != nil {
			listenerRevertFunc(completion)
		}
		listener.count++
		s.listeners[name] = listener
		s.mutex.Unlock()
	}
}
424208
func (d *eventDispatcher) RemoveEventListener(typ string, listener EventListener) {
	d.Lock()
	defer d.Unlock()

	// Grab a reference to the function pointer once.
	ptr := reflect.ValueOf(listener).Pointer()

	// Find listener by pointer and remove it.
	listeners := d.listeners[typ]
	for i, l := range listeners {
		if reflect.ValueOf(l).Pointer() == ptr {
			d.listeners[typ] = append(listeners[:i], listeners[i+1:]...)
		}
	}
}
785705
func (ns *NamedStopwatch) Delete(name string) {
	ns.Lock()
	defer ns.Unlock()

	if ns.stopwatches == nil {
		return
	}

	delete(ns.stopwatches, name) // check if it exists in case the user did the wrong thing
}
629766
func (c *Client) Remove(name string) error {
	return delete(c, name, false)
}
485677
func Change(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "change", Listener: listener}
}
917956
func (sim *simra) RemoveCollisionListener(c1, c2 Collider) {
	// TODO: exclusive control
	simlog.FuncIn()
	sim.removeCollisionMap(&collisionMap{c1, c2, nil})
	simlog.FuncOut()
}