1
1

Be a little more thorough about cleaning up during finalize

This commit was SVN r24014.
Этот коммит содержится в:
Ralph Castain 2010-11-09 14:56:27 +00:00
родитель d3701ccba8
Коммит 01347926d1

Просмотреть файл

@ -20,6 +20,8 @@
int orte_rmcast_base_close(void)
{
opal_list_item_t *item;
if (!orte_rmcast_base.opened) {
return ORTE_SUCCESS;
}
@ -30,6 +32,20 @@ int orte_rmcast_base_close(void)
}
/* cleanup thread stuff */
OBJ_DESTRUCT(&orte_rmcast_base.lock);
OBJ_DESTRUCT(&orte_rmcast_base.cond);
while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.recvs))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&orte_rmcast_base.recvs);
while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.channels))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&orte_rmcast_base.channels);
while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.msg_list))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&orte_rmcast_base.msg_list);
OBJ_DESTRUCT(&orte_rmcast_base.recv_thread);
OBJ_DESTRUCT(&orte_rmcast_base.recv_ctl);
OBJ_DESTRUCT(&orte_rmcast_base.recv_process);
@ -37,13 +53,11 @@ int orte_rmcast_base_close(void)
opal_event_base_finalize(orte_rmcast_base.event_base);
/* Close all remaining available components (may be one if this is a
Open RTE program, or [possibly] multiple if this is ompi_info) */
Open RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(orte_rmcast_base.rmcast_output,
&orte_rmcast_base.rmcast_opened, NULL);
mca_base_components_close(orte_rmcast_base.rmcast_output,
&orte_rmcast_base.rmcast_opened, NULL);
orte_rmcast_base.opened = false;
OBJ_DESTRUCT(&orte_rmcast_base.lock);
OBJ_DESTRUCT(&orte_rmcast_base.cond);
return ORTE_SUCCESS;
}