1
1

Ensure to catch a corner case where a component is released that was

only loaded by dependencies

This commit was SVN r1795.
Этот коммит содержится в:
Jeff Squyres 2004-07-22 14:58:25 +00:00
родитель a061f0f19d
Коммит b7ab0c2c1b

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

@ -264,7 +264,7 @@ static void release_repository_item(repository_item_t *ri)
/* Decrement this module's refcount. If zero, close and free it. */ /* Decrement this module's refcount. If zero, close and free it. */
--ri->ri_refcount; --ri->ri_refcount;
if (0 == ri->ri_refcount) { if (0 <= ri->ri_refcount) {
lt_dlclose(ri->ri_dlhandle); lt_dlclose(ri->ri_dlhandle);
/* Now go release/close (at a minimum: decrement the refcount) any /* Now go release/close (at a minimum: decrement the refcount) any
@ -275,6 +275,9 @@ static void release_repository_item(repository_item_t *ri)
item = ompi_list_remove_first(&ri->ri_dependencies)) { item = ompi_list_remove_first(&ri->ri_dependencies)) {
di = (dependency_item_t *) item; di = (dependency_item_t *) item;
--di->di_repository_entry->ri_refcount; --di->di_repository_entry->ri_refcount;
if (0 == di->di_repository_entry->ri_refcount) {
release_repository_item(di->di_repository_entry);
}
free(di); free(di);
} }