From 7579ae3086836af348b0564f032be709d24e097f Mon Sep 17 00:00:00 2001 From: Raghavendra Pendyala Date: Fri, 9 Oct 2015 10:49:44 -0700 Subject: [PATCH 1/2] Releasing the list items when list destructor is called --- opal/class/opal_list.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/opal/class/opal_list.c b/opal/class/opal_list.c index e0a5112c38a..ed20659a089 100644 --- a/opal/class/opal_list.c +++ b/opal/class/opal_list.c @@ -97,11 +97,17 @@ static void opal_list_construct(opal_list_t *list) /* - * Reset all the pointers to be NULL -- do not actually destroy - * anything. + * Release the list items in the list. + * Reset list pointers to be NULL */ static void opal_list_destruct(opal_list_t *list) { + opal_list_item_t *it; + + while (NULL != (it = opal_list_remove_first(list))) { + OBJ_RELEASE(it); + } + opal_list_construct(list); } From 720fa860eee7df4f06eb5604058da57453e88b46 Mon Sep 17 00:00:00 2001 From: Raghavendra Pendyala Date: Tue, 20 Oct 2015 12:58:23 -0700 Subject: [PATCH 2/2] changing the destruct function of list release API to release list items caused a bug in oshmem application. Fixing the bug with this patch --- oshmem/mca/memheap/base/memheap_base_mkey.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oshmem/mca/memheap/base/memheap_base_mkey.c b/oshmem/mca/memheap/base/memheap_base_mkey.c index 2d9e4f58418..7cea9c7eda3 100644 --- a/oshmem/mca/memheap/base/memheap_base_mkey.c +++ b/oshmem/mca/memheap/base/memheap_base_mkey.c @@ -482,6 +482,11 @@ void memheap_oob_destruct(void) MPI_Request_free(&r->recv_req); } + /*clear these list object as they don't belong here */ + while (NULL != opal_list_remove_first(&memheap_oob.req_list)) { + continue; + } + OBJ_DESTRUCT(&memheap_oob.req_list); OBJ_DESTRUCT(&memheap_oob.lck); OBJ_DESTRUCT(&memheap_oob.cond);