@@ -698,24 +698,14 @@ static int component_startup(void)
698
698
static void component_shutdown (void )
699
699
{
700
700
mca_oob_tcp_peer_t * peer ;
701
- uint64_t ui64 ;
702
- int i = 0 ;
701
+ int i = 0 , rc ;
702
+ uint64_t key ;
703
+ void * node ;
703
704
704
705
opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
705
706
"%s TCP SHUTDOWN" ,
706
707
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
707
708
708
- /* cleanup all peers */
709
- OPAL_HASH_TABLE_FOREACH (ui64 , uint64 , peer , & mca_oob_tcp_component .peers ) {
710
- opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
711
- "%s RELEASING PEER OBJ %s" ,
712
- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
713
- (NULL == peer ) ? "NULL" : ORTE_NAME_PRINT (& peer -> name ));
714
- if (NULL != peer ) {
715
- OBJ_RELEASE (peer );
716
- }
717
- }
718
-
719
709
if (0 < orte_oob_base .num_threads ) {
720
710
for (i = 0 ; i < orte_oob_base .num_threads ; i ++ ) {
721
711
opal_progress_thread_finalize (mca_oob_tcp_component .ev_threads [i ]);
@@ -734,6 +724,18 @@ static void component_shutdown(void)
734
724
"no hnp or not active" );
735
725
}
736
726
727
+ /* release all peers from the hash table */
728
+ rc = opal_hash_table_get_first_key_uint64 (& mca_oob_tcp_component .peers , & key ,
729
+ (void * * )& peer , & node );
730
+ while (OPAL_SUCCESS == rc ) {
731
+ if (NULL != peer ) {
732
+ OBJ_RELEASE (peer );
733
+ opal_hash_table_set_value_uint64 (& mca_oob_tcp_component .peers , key , NULL );
734
+ }
735
+ rc = opal_hash_table_get_next_key_uint64 (& mca_oob_tcp_component .peers , & key ,
736
+ (void * * ) & peer , node , & node );
737
+ }
738
+
737
739
opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
738
740
"%s TCP SHUTDOWN done" ,
739
741
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
0 commit comments