aquire and release
This commit is contained in:
@@ -95,14 +95,19 @@ namespace Archimedes {
|
||||
std::list<std::variant<std::string, Module*>> toOpen;
|
||||
|
||||
void handleEvents() {
|
||||
bool handled = false;
|
||||
static bool handled;
|
||||
while(!events.empty()) {
|
||||
|
||||
handled = false;
|
||||
|
||||
for(auto it = runOrder.rbegin(); it != runOrder.rend(); it++) {
|
||||
if(modules[*it]->onEvent(*events.front())) {
|
||||
|
||||
handled = modules[*it]->onEvent(*events.front());
|
||||
|
||||
if(handled) {
|
||||
Event* e = events.front();
|
||||
events.pop_front();
|
||||
delete e;
|
||||
handled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +115,6 @@ namespace Archimedes {
|
||||
if(!handled) {
|
||||
std::cout << "Error: Unhandled Event: " << (std::string) *events.front() << std::endl;
|
||||
}
|
||||
handled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user