ted-ross commented on a change in pull request #463: DISPATCH-1276 - Added a 
cleanup function qdrc_address_endpoint_cleanu…
URL: https://github.com/apache/qpid-dispatch/pull/463#discussion_r265678937
 
 

 ##########
 File path: src/router_core/modules/edge_addr_tracking/edge_addr_tracking.c
 ##########
 @@ -133,18 +133,30 @@ static void qdrc_address_endpoint_on_first_detach(void 
*link_context,
 {
     qdr_addr_endpoint_state_t *endpoint_state  = (qdr_addr_endpoint_state_t 
*)link_context;
     qdrc_endpoint_detach_CT(endpoint_state->mc->core, 
endpoint_state->endpoint, 0);
-    qdr_addr_tracking_module_context_t *mc = endpoint_state->mc;
-    DEQ_REMOVE(mc->endpoint_state_list, endpoint_state);
-    endpoint_state->conn = 0;
-    endpoint_state->endpoint = 0;
-    if (endpoint_state->link) {
-        endpoint_state->link->edge_context = 0;
-        endpoint_state->link = 0;
-    }
-    free_qdr_addr_endpoint_state_t(endpoint_state);
     qdr_error_free(error);
 }
 
+static void qdrc_address_endpoint_cleanup(void *link_context)
+{
+    qdr_addr_endpoint_state_t *endpoint_state  = (qdr_addr_endpoint_state_t 
*)link_context;
+    if (endpoint_state) {
+        qdr_addr_tracking_module_context_t *mc = endpoint_state->mc;
+        assert (endpoint_state->conn);
+        endpoint_state->closed = true;
+        if (endpoint_state->ref_count == 1) {
 
 Review comment:
   I'm unclear as to why the state is freed when the ref_count is still 1.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to