Fixed bug in ModuleManager::GetModule(): The module pointer was not returned, when the module was already loaded.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2291 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
aa29ed9aa1
commit
6749e47f61
|
@ -286,15 +286,20 @@ ModuleManager::GetModule(const char *path, module_info **infop)
|
|||
BAutolock _lock(fModules);
|
||||
Module *module = fModules.FindModule(path);
|
||||
if (!module) {
|
||||
// module not yet loaded, try to get it
|
||||
module = new Module;
|
||||
error = module->Init(path);
|
||||
if (error == B_OK && !fModules.AddModule(module))
|
||||
error = B_NO_MEMORY;
|
||||
if (error == B_OK) {
|
||||
module->Get();
|
||||
*infop = module->Info();
|
||||
} else
|
||||
if (error != B_OK) {
|
||||
delete module;
|
||||
module = NULL;
|
||||
}
|
||||
}
|
||||
// "get" the module
|
||||
if (error == B_OK) {
|
||||
module->Get();
|
||||
*infop = module->Info();
|
||||
}
|
||||
}
|
||||
return error;
|
||||
|
|
Loading…
Reference in New Issue