diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 9e81200981..1ae880dc7e 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -341,11 +341,6 @@ int ompi_mpi_finalize(void) return ret; } - /* free proc resources */ - if ( OMPI_SUCCESS != (ret = ompi_proc_finalize())) { - return ret; - } - /* finalize the pubsub functions */ if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_pubsub_base_framework) ) ) { return ret; @@ -420,6 +415,11 @@ int ompi_mpi_finalize(void) return ret; } + /* free proc resources */ + if ( OMPI_SUCCESS != (ret = ompi_proc_finalize())) { + return ret; + } + if (NULL != ompi_mpi_main_thread) { OBJ_RELEASE(ompi_mpi_main_thread); ompi_mpi_main_thread = NULL; diff --git a/opal/mca/btl/tcp/btl_tcp_proc.c b/opal/mca/btl/tcp/btl_tcp_proc.c index fdccee42b5..bd06ec1574 100644 --- a/opal/mca/btl/tcp/btl_tcp_proc.c +++ b/opal/mca/btl/tcp/btl_tcp_proc.c @@ -84,8 +84,8 @@ void mca_btl_tcp_proc_destruct(mca_btl_tcp_proc_t* tcp_proc) opal_proc_table_remove_value(&mca_btl_tcp_component.tcp_procs, tcp_proc->proc_opal->proc_name); OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock); - /* Do not OBJ_RELEASE the proc_opal ! */ - /* OBJ_RELEASE(tcp_proc->proc_opal); */ + OBJ_RELEASE(tcp_proc->proc_opal); + tcp_proc->proc_opal = NULL; } /* release resources */ if(NULL != tcp_proc->proc_endpoints) {