1
1

Remove the segfault in ompi_info, when we try to destruct a not yet

constructed object.

This commit was SVN r9308.
Этот коммит содержится в:
George Bosilca 2006-03-16 16:56:22 +00:00
родитель d5d552c97b
Коммит 4aa343990f
3 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -34,6 +34,12 @@ int mca_mpool_base_close(void)
{
opal_list_item_t *item;
mca_mpool_base_selected_module_t *sm;
int32_t modules_length;
/* Need the initial length in order to know if some of the initializations
* are done in the open function.
*/
modules_length = opal_list_get_size(&mca_mpool_base_modules);
/* Finalize all the mpool components and free their list items */
@ -60,11 +66,11 @@ int mca_mpool_base_close(void)
&mca_mpool_base_components, NULL);
/* deregister memory free callback */
if(mca_mpool_base_use_mem_hooks &&
if( (modules_length > 0) && mca_mpool_base_use_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_unregister_release(mca_mpool_base_mem_cb);
OBJ_DESTRUCT(&mca_mpool_base_mem_cb_array);
}
OBJ_DESTRUCT(&mca_mpool_base_mem_cb_array);
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -93,6 +93,7 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
if(mca_mpool_base_use_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_register_release(mca_mpool_base_mem_cb, NULL);
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t);
}
#if defined(HAVE_MALLOPT)
@ -102,7 +103,6 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
}
#endif /* defined(HAVE_MALLOPT) */
}
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t);
return module;
}

Просмотреть файл

@ -52,7 +52,6 @@ uint32_t mca_mpool_base_page_size_log;
opal_list_t mca_mpool_base_components;
opal_list_t mca_mpool_base_modules;
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.