From 6fe84f581b5bcec21720c33a2b99d69a72ebc6de Mon Sep 17 00:00:00 2001 From: Pavel Shamis Date: Mon, 26 Feb 2007 16:25:20 +0000 Subject: [PATCH] mpool_base_module_destroy was removing all modules from a list instead of removing specific one. Fixing the bug. This commit was SVN r13795. --- ompi/mca/mpool/base/mpool_base_lookup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ompi/mca/mpool/base/mpool_base_lookup.c b/ompi/mca/mpool/base/mpool_base_lookup.c index 1bfadabe9f..f5d593e4b5 100644 --- a/ompi/mca/mpool/base/mpool_base_lookup.c +++ b/ompi/mca/mpool/base/mpool_base_lookup.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006-2007 Mellanox Technologies. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -134,11 +135,12 @@ int mca_mpool_base_module_destroy(mca_mpool_base_module_t *module) opal_list_item_t* item; mca_mpool_base_selected_module_t *sm; - for (item = opal_list_remove_first(&mca_mpool_base_modules); - NULL != item; - item = opal_list_remove_first(&mca_mpool_base_modules)) { + for (item = opal_list_get_first(&mca_mpool_base_modules); + item != opal_list_get_end(&mca_mpool_base_modules); + item = opal_list_get_next(item)) { sm = (mca_mpool_base_selected_module_t *) item; if (module == sm->mpool_module) { + opal_list_remove_item(&mca_mpool_base_modules,item); if (NULL != sm->mpool_module->mpool_finalize) { sm->mpool_module->mpool_finalize(sm->mpool_module); }