diff --git a/opal/class/opal_list.c b/opal/class/opal_list.c index e0a5112c38..ed20659a08 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); } diff --git a/oshmem/mca/memheap/base/memheap_base_mkey.c b/oshmem/mca/memheap/base/memheap_base_mkey.c index 95b770e6d4..aa26ad373f 100644 --- a/oshmem/mca/memheap/base/memheap_base_mkey.c +++ b/oshmem/mca/memheap/base/memheap_base_mkey.c @@ -452,6 +452,11 @@ void memheap_oob_destruct(void) PMPI_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);