---
name: "mongoc_client_pool_destroy"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_pool_destroy"
---

# mongoc\_client\_pool\_destroy(3)

## SYNOPSIS

```
void
mongoc_client_pool_destroy (mongoc_client_pool_t *pool);
```

Release all resources associated with **pool**, including freeing the structure.

All *mongoc\_client\_t* objects obtained from *mongoc\_client\_pool\_pop()* from **pool** must be pushed back onto the pool with *mongoc\_client\_pool\_push()* prior to calling *mongoc\_client\_pool\_destroy()*.

This method is NOT thread safe, and must only be called by one thread. It should be called once the application is shutting down, and after all other threads that use clients have been joined.

## PARAMETERS

- •

  **pool**: A *mongoc\_client\_pool\_t*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
