Do not reference qdr connection after it is closed
This closes
@@ -489,15 +489,16 @@ static void handle_disconnected(qdr_tcp_connection_t* conn)
conn->conn_id, conn->outgoing_id);
qdr_link_detach(conn->outgoing, QD_LOST, 0);
}
- if (conn->qdr_conn) {
- qdr_connection_closed(conn->qdr_conn);
- qdr_connection_set_context(conn->qdr_conn, 0);
- }
if (conn->initial_delivery) {
qdr_delivery_remote_state_updated(tcp_adaptor->core, conn->initial_delivery, PN_RELEASED, true, 0, false);
qdr_delivery_decref(tcp_adaptor->core, conn->initial_delivery, "tcp-adaptor.handle_disconnected - initial_delivery");
conn->initial_delivery = 0;
}
+ if (conn->qdr_conn) {
+ qdr_connection_set_context(conn->qdr_conn, 0);
+ qdr_connection_closed(conn->qdr_conn);
+ conn->qdr_conn = 0;
+ }
//need to free on core thread to avoid deleting while in use by management agent
qdr_action_t *action = qdr_action(qdr_del_tcp_connection_CT, "delete_tcp_connection");
