Zeroed the qd_link->pn_link reference so there would be no attempt to send out a detach by CORE_link_detach if the outgoing pn_link has already been freed
@@ -401,8 +401,14 @@ void qd_conn_event_batch_complete(qd_container_t *container, qd_connection_t *qd
while(to_free) {
if (!conn_closed) {
- if (to_free->pn_link)
+ if (to_free->pn_link) {
+ qd_link_t *qd_link = (qd_link_t*) pn_link_get_context(to_free->pn_link);
+ if (qd_link) {
+ qd_link->pn_link = 0;
+ }
+ pn_link_set_context(to_free->pn_link, 0);
pn_link_free(to_free->pn_link);
+ }
if (to_free->pn_session)
pn_session_free(to_free->pn_session);
}
