// Clear clears any objects sitting idle in the pool, releasing any associated
// resources (optional operation). Idle objects cleared must be
// PooledObjectFactory.DestroyObject(PooledObject) .
Clear clears any objects sitting idle in the pool, releasing any associated
resources (optional operation). Idle objects cleared must be
PooledObjectFactory.DestroyObject(PooledObject) .
// Clear clears any objects sitting idle in the pool releasing any associated // resources ( optional operation ) . Idle objects cleared must be // PooledObjectFactory . DestroyObject ( PooledObject ) .
func (pool *ObjectPool) Clear() {
	p, ok := pool.idleObjects.PollFirst().(*PooledObject)
	for ok {
		pool.destroy(p)
		p, ok = pool.idleObjects.PollFirst().(*PooledObject)
	}
}
func ( pool * ObjectPool ) Clear ( ) { p , ok := pool . idleObjects . PollFirst ( ) . ( * PooledObject ) for ok { pool . destroy ( p ) p , ok = pool . idleObjects . PollFirst ( ) . ( * PooledObject ) } }
Clear clears any objects sitting idle in the pool, releasing any associated
resources (optional operation).
Clear clears any objects sitting idle in the pool releasing any associated resources ( optional operation ) .