// CloseAll tries to close all objects and return all errors (there are nils if there was no errors).
// DEPRECATED - use safeclose.Close(...) instead
321958
func CloseAll(objs ...interface{}) ([]error, error) {
	logrus.DefaultLogger().Debugf("safeclose.CloseAll() is DEPRECATED! Please use safeclose.Close() instead")

	errs := make([]error, len(objs))

	for i, obj := range objs {
		errs[i] = Close(obj)
	}

	for _, err := range errs {
		if err != nil {
			return errs, CloseErrors(errs)
		}
	}

	return errs, nil
}
205312
func (u readCloser) Close() error {
	if u.file != nil {
		return u.file.Close()
	}
	return nil
}
917794
func (ql *QueryList) TerminateAll() {
	ql.mu.Lock()
	defer ql.mu.Unlock()
	for _, qd := range ql.queryDetails {
		qd.conn.Kill("QueryList.TerminateAll()", time.Since(qd.start))
	}
}
277564
func (w *Window) Close() bool {
	if !w.CloseAllViews() {
		return false
	}
	GetEditor().remove(w)

	return true
}
410739
func (iter *iteratorSingle) Close() error {
	if iter.closer != nil {
		iter.closer.Close()
		iter.closer = nil
	}

	return nil
}
1187498
func (connection *redisConnection) CloseAllQueuesInConnection() error {
	connection.redisClient.Del(connection.queuesKey)
	// debug(fmt.Sprintf("connection closed all queues %s %d", connection, connection.queuesKey)) // COMMENTOUT
	return nil
}
789463
func (p *Plugin) Close() error {
	//TODO close error report channel

	p.mu.Lock()
	defer p.mu.Unlock()

	p.registrations = make(map[string]*registration)

	return nil
}
292291
func (c *Cache) DeleteAll() {
	var keys []interface{}
	c.m.Range(func(key interface{}, value interface{}) bool {
		c.close(key.(string), value.(future))
		keys = append(keys, key)
		return true
	})

	for _, key := range keys {
		c.m.Delete(key)
	}
}
1182326
func (m *ChannelDeMultiplexer) Close() {
	m.lock.Lock()
	defer m.lock.Unlock()
	m.closed = true
	for _, ch := range m.channels {
		close(ch.ch)
	}
	m.channels = nil
}
380612
func (w *writeCloseInformer) Close() error {
	err := w.wc.Close()
	close(w.close)
	return err
}
574202
func (a MultiStatsClient) Close() error {
	for _, c := range a {
		err := c.Close()
		if err != nil {
			return err
		}
	}
	return nil
}
1350040
func (f deleteOnCloseFile) Close() error {
	f.File.Close()
	os.Remove(f.Name())
	return nil
}
176589
func (rm *ResultMerger) Close(ctx context.Context) {
	for _, i := range rm.allInputs {
		i.Close(ctx)
	}
}
250773
func (loop Loop) Close() error {
	errc := make(chan error)
	loop.closing <- errc
	return <-errc
}
207024
func (w *Window) CloseAllViews() bool {
	for len(w.views) > 0 {
		if !w.views[0].Close() {
			return false
		}
	}

	return true
}
122390
func (c *consumerGroup) Close() (err error) {
	c.closeOnce.Do(func() {
		close(c.closed)

		c.lock.Lock()
		defer c.lock.Unlock()

		// leave group
		if e := c.leave(); e != nil {
			err = e
		}

		// drain errors
		go func() {
			close(c.errors)
		}()
		for e := range c.errors {
			err = e
		}

		if e := c.client.Close(); e != nil {
			err = e
		}
	})
	return
}
161711
func (m *Broadcaster) closeAll() {
	m.lock.Lock()
	defer m.lock.Unlock()
	for _, w := range m.watchers {
		close(w.result)
	}
	// Delete everything from the map, since presence/absence in the map is used
	// by stopWatching to avoid double-closing the channel.
	m.watchers = map[int64]*broadcasterWatcher{}
}