Fixed bug with Insight QApplication object being created too soon, which in turn caused issues with signal capturing.

Also ensured that we only initialise the Insight object when the user has enabled Insight in their config.
This commit is contained in:
Nav
2021-08-11 00:07:12 +01:00
parent bf7233e01b
commit 7a6dcdcbfd
4 changed files with 31 additions and 9 deletions

View File

@@ -44,10 +44,11 @@ int Application::run(const std::vector<std::string>& arguments) {
this->startup();
if (this->insightConfig.insightEnabled) {
this->insight.setApplicationConfig(this->applicationConfig);
this->insight.setEnvironmentConfig(this->environmentConfig);
this->insight.setInsightConfig(this->insightConfig);
this->insight.run();
this->insight = std::make_unique<Insight>(this->eventManager);
this->insight->setApplicationConfig(this->applicationConfig);
this->insight->setEnvironmentConfig(this->environmentConfig);
this->insight->setInsightConfig(this->insightConfig);
this->insight->run();
Logger::debug("Insight closed");
this->shutdown();
return EXIT_SUCCESS;