Skip to content

Commit 2c1980a

Browse files
authored
Merge pull request #2923 from hjelmn/oob_fix
oob/tcp: cleanup peers before event bases
2 parents 3c18f2f + 1c4b735 commit 2c1980a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

orte/mca/oob/tcp/oob_tcp_component.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
13+
* Copyright (c) 2006-2017 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1616
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
@@ -182,22 +182,9 @@ static int tcp_component_open(void)
182182
*/
183183
static int tcp_component_close(void)
184184
{
185-
mca_oob_tcp_peer_t *peer;
186-
uint64_t ui64;
187-
188185
/* cleanup listen event list */
189186
OBJ_DESTRUCT(&mca_oob_tcp_component.listeners);
190187

191-
/* cleanup all peers */
192-
OPAL_HASH_TABLE_FOREACH(ui64, uint64, peer, &mca_oob_tcp_component.peers) {
193-
opal_output_verbose(2, orte_oob_base_framework.framework_output,
194-
"%s RELEASING PEER OBJ %s",
195-
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
196-
(NULL == peer) ? "NULL" : ORTE_NAME_PRINT(&peer->name));
197-
if (NULL != peer) {
198-
OBJ_RELEASE(peer);
199-
}
200-
}
201188
OBJ_DESTRUCT(&mca_oob_tcp_component.peers);
202189

203190
if (NULL != mca_oob_tcp_component.ipv4conns) {
@@ -722,13 +709,26 @@ static void cleanup(int sd, short args, void *cbdata)
722709

723710
static void component_shutdown(void)
724711
{
712+
mca_oob_tcp_peer_t *peer;
713+
uint64_t ui64;
725714
int i = 0;
726715
bool active;
727716

728717
opal_output_verbose(2, orte_oob_base_framework.framework_output,
729718
"%s TCP SHUTDOWN",
730719
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
731720

721+
/* cleanup all peers */
722+
OPAL_HASH_TABLE_FOREACH(ui64, uint64, peer, &mca_oob_tcp_component.peers) {
723+
opal_output_verbose(2, orte_oob_base_framework.framework_output,
724+
"%s RELEASING PEER OBJ %s",
725+
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
726+
(NULL == peer) ? "NULL" : ORTE_NAME_PRINT(&peer->name));
727+
if (NULL != peer) {
728+
OBJ_RELEASE(peer);
729+
}
730+
}
731+
732732
if (0 < orte_oob_base.num_threads) {
733733
for (i=0; i < orte_oob_base.num_threads; i++) {
734734
opal_progress_thread_finalize(mca_oob_tcp_component.ev_threads[i]);

0 commit comments

Comments
 (0)