qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject [qpid-dispatch] branch master updated: DISPATCH-1214 - Clean up qd_link_ref_t objects associated with the link before freeing it
Date Tue, 18 Dec 2018 21:54:17 GMT
This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 8dffff4  DISPATCH-1214 - Clean up qd_link_ref_t objects associated with the link
before freeing it
8dffff4 is described below

commit 8dffff4fb1f9c62e54b0dddcc3aa7f2b2b5ca10a
Author: Ganesh Murthy <gmurthy@redhat.com>
AuthorDate: Tue Dec 18 16:53:56 2018 -0500

    DISPATCH-1214 - Clean up qd_link_ref_t objects associated with the link before freeing
it
---
 src/container.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/container.c b/src/container.c
index c3a2361..12c89b9 100644
--- a/src/container.c
+++ b/src/container.c
@@ -880,6 +880,19 @@ void qd_link_free(qd_link_t *link)
     sys_mutex_lock(container->lock);
     DEQ_REMOVE(container->links, link);
     sys_mutex_unlock(container->lock);
+
+
+    qd_link_ref_list_t *list = qd_link_get_ref_list(link);
+
+    if (list) {
+        qd_link_ref_t *link_ref = DEQ_HEAD (*list);
+        while (link_ref) {
+            DEQ_REMOVE_HEAD(*list);
+            free_qd_link_ref_t(link_ref);
+            link_ref = DEQ_HEAD (*list);
+        }
+    }
+
     free_qd_link_t(link);
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message