PooledLDAPConnection::setup spawns an asynchronous task which is responsible for establishing a connection to a remote LDAP server, and waiting for it to successfully respond to a command. This task does not anchor the PooledLDAPConnection, which is held by its per-host connection pool. If the owning connection pool times out and is reaped, the PooledLDAPConnection may be desconstructed while being used by the callback.
The callback spawned by PooledLDAPConnection::setup should retain a std::shared_ptr to the PooledLDAPConnection which dispatched it.