put_module_image() is now again called independently from B_KEEP_LOADED - that has

the advantage that module_image::ref_count does not get messed up, so we could still
determine when to unload such a module (with an extra function).
get_module() now calls put_module_image() if B_MODULE_INIT failed - failing modules
were never unloaded before...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12343 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-04-12 08:55:03 +00:00
parent e6963ff534
commit e826b3f47e

View File

@ -1376,7 +1376,8 @@ get_module(const char *path, module_info **_info)
if (status == B_OK) {
inc_module_ref_count(module);
*_info = module->info;
}
} else if ((module->flags & B_BUILT_IN_MODULE) == 0)
put_module_image(module->module_image);
recursive_lock_unlock(&sModulesLock);
return status;
@ -1408,11 +1409,11 @@ put_module(const char *path)
if (module->ref_count == 0)
uninit_module(module);
if ((module->flags & B_BUILT_IN_MODULE) == 0)
put_module_image(module->module_image);
}
if ((module->flags & B_BUILT_IN_MODULE) == 0)
put_module_image(module->module_image);
recursive_lock_unlock(&sModulesLock);
return B_OK;
}