MONGOC_CLIENT_POOL_DESTROY(3)

πŸ’– MONGOC_CLIENT_POOL_DESTROY πŸ’–

okay bestie, this is the mongoc_client_pool_destroy(3) page from libmongoc, and it's literally the "bye bye pool" function 🫢


✨ SYNOPSIS ✨

void
mongoc_client_pool_destroy (mongoc_client_pool_t *pool);

🌸 DESCRIPTION 🌸

So like, this one frees all resources associated with pool, including freeing the structure itself. Like fully yeeting it into the void, no cap πŸ’…

Here's the part you CANNOT skip, bestie β€” every single mongoc_client_t object you got 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(). Like, put your clients back in the toybox before you throw the toybox away, mkay? πŸ™ˆ

⚠️ Vibe check, and it FAILS: this method is NOT thread safe, and must only be called by one thread. One. Singular. Main character energy only, no group chat. 😭

It should be called once the application is shutting down, and after all other threads that use clients have been joined. Like, wait for the group chat to go quiet before you close it, yk? πŸ”₯


πŸŽ€ PARAMETERS πŸŽ€

  • pool β€” A mongoc_client_pool_t. That's it, that's the whole list, she's low maintenance πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” iconic of them fr fr


2009-present, MongoDB, Inc.


⭐ aaaand that's the page! this lovely little doc came from libmongoc version 2.5.6, dated Oct 09, 2026 β€” go destroy those pools responsibly, bestie, and remember: push your clients back first πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from