diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index ebdfd5cc5b..09aaf6653b 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2006-2012 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006 University of Houston. All rights reserved. @@ -398,6 +398,11 @@ int ompi_mpi_finalize(void) return ret; } + if (NULL != ompi_mpi_main_thread) { + OBJ_RELEASE(ompi_mpi_main_thread); + ompi_mpi_main_thread = NULL; + } + /* Leave the RTE */ if (OMPI_SUCCESS != (ret = ompi_rte_finalize())) {