Fix race condition that led to connection reopen in spite of connector being deleted
@@ -846,8 +846,11 @@ void qd_connection_manager_delete_connector(qd_dispatch_t *qd, void *impl)
qd_connector_t *ct = (qd_connector_t*) impl;
if (ct) {
sys_mutex_lock(ct->lock);
- if (ct->ctx && ct->ctx->pn_conn) {
+ if (ct->ctx) {
+ ct->ctx->connector = 0;
+ if(ct->ctx->pn_conn)
qd_connection_invoke_deferred(ct->ctx, deferred_close, ct->ctx->pn_conn);
+
}
sys_mutex_unlock(ct->lock);
DEQ_REMOVE(qd->connection_manager->connectors, ct);
