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());
|
||||
|
||||
for(auto it = blacklist.begin(); it != blacklist.end(); it++) {
|
||||
if(*it == m->getName()) {
|
||||
std::cout << "Module \"" << *it << "\" is already loaded!\n";
|
||||
delete m;
|
||||
dlclose(h);
|
||||
return false;
|
||||
if(!blacklist.empty()) {
|
||||
for(auto it = blacklist.begin(); it != blacklist.end(); it++) {
|
||||
if(*it == m->getName()) {
|
||||
std::cout << "Module \"" << *it << "\" is already loaded!\n";
|
||||
delete m;
|
||||
dlclose(h);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blacklist.push_back(m->getName());
|
||||
|
||||
bool skip = false;
|
||||
|
||||
for(auto s = blacklist.begin(); s != blacklist.end(); s++) {
|
||||
auto it = m->deps.find(*s);
|
||||
if(it != m->deps.end())
|
||||
skip = true;
|
||||
if(skip) {
|
||||
skip = false;
|
||||
continue;
|
||||
} else {
|
||||
load(it->second, blacklist);
|
||||
if(!m->deps.empty()) {
|
||||
bool skip = false;
|
||||
for(auto s = blacklist.begin(); s != blacklist.end(); s++) {
|
||||
auto it = m->deps.find(*s);
|
||||
if(it != m->deps.end())
|
||||
skip = true;
|
||||
if(skip) {
|
||||
skip = false;
|
||||
continue;
|
||||
} else {
|
||||
load(it->second, blacklist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user