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:
@@ -1376,7 +1376,8 @@ get_module(const char *path, module_info **_info)
|
|||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
inc_module_ref_count(module);
|
inc_module_ref_count(module);
|
||||||
*_info = module->info;
|
*_info = module->info;
|
||||||
}
|
} else if ((module->flags & B_BUILT_IN_MODULE) == 0)
|
||||||
|
put_module_image(module->module_image);
|
||||||
|
|
||||||
recursive_lock_unlock(&sModulesLock);
|
recursive_lock_unlock(&sModulesLock);
|
||||||
return status;
|
return status;
|
||||||
@@ -1408,11 +1409,11 @@ put_module(const char *path)
|
|||||||
|
|
||||||
if (module->ref_count == 0)
|
if (module->ref_count == 0)
|
||||||
uninit_module(module);
|
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);
|
recursive_lock_unlock(&sModulesLock);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user