work?
This commit is contained in:
37
src/App.cpp
37
src/App.cpp
@@ -47,28 +47,31 @@ bool App::load(std::string lib, std::list<std::string> blacklist = {}) {
|
|||||||
|
|
||||||
Module* m = create(h, App::Get());
|
Module* m = create(h, App::Get());
|
||||||
|
|
||||||
for(auto it = blacklist.begin(); it != blacklist.end(); it++) {
|
if(!blacklist.empty()) {
|
||||||
if(*it == m->getName()) {
|
for(auto it = blacklist.begin(); it != blacklist.end(); it++) {
|
||||||
std::cout << "Module \"" << *it << "\" is already loaded!\n";
|
if(*it == m->getName()) {
|
||||||
delete m;
|
std::cout << "Module \"" << *it << "\" is already loaded!\n";
|
||||||
dlclose(h);
|
delete m;
|
||||||
return false;
|
dlclose(h);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blacklist.push_back(m->getName());
|
blacklist.push_back(m->getName());
|
||||||
|
|
||||||
bool skip = false;
|
if(!m->deps.empty()) {
|
||||||
|
bool skip = false;
|
||||||
for(auto s = blacklist.begin(); s != blacklist.end(); s++) {
|
for(auto s = blacklist.begin(); s != blacklist.end(); s++) {
|
||||||
auto it = m->deps.find(*s);
|
auto it = m->deps.find(*s);
|
||||||
if(it != m->deps.end())
|
if(it != m->deps.end())
|
||||||
skip = true;
|
skip = true;
|
||||||
if(skip) {
|
if(skip) {
|
||||||
skip = false;
|
skip = false;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
load(it->second, blacklist);
|
load(it->second, blacklist);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user