Handling any events that were dispatched to the main thread event listener, during startup, before passing control of the main thread over to Insight.

This commit is contained in:
Nav
2021-09-24 23:23:22 +01:00
parent 267e59fcce
commit bad0c79f65

View File

@@ -49,8 +49,18 @@ int Application::run(const std::vector<std::string>& arguments) {
this->insight->setApplicationConfig(this->applicationConfig);
this->insight->setEnvironmentConfig(this->environmentConfig);
this->insight->setInsightConfig(this->insightConfig);
this->insight->run();
Logger::debug("Insight closed");
/*
* Before letting Insight occupy the main thread, process any pending events that accumulated
* during startup.
*/
this->applicationEventListener->dispatchCurrentEvents();
if (Thread::getThreadState() == ThreadState::READY) {
this->insight->run();
Logger::debug("Insight closed");
}
this->shutdown();
return EXIT_SUCCESS;
}