Commit 23e9acf2 authored by Don Gagne's avatar Don Gagne

Cleanup application object

parent 647ee6cc
......@@ -130,6 +130,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[]) :
}
QGCApplication::~QGCApplication()
{
destroySingletonsForUnitTest();
delete _mainWindow;
}
void QGCApplication::_initCommon(void)
{
_createSingletons();
......@@ -276,15 +282,6 @@ bool QGCApplication::_initForUnitTests(void)
return true;
}
/**
* @brief Destructor for the groundstation. It destroys all loaded instances.
*
**/
QGCApplication::~QGCApplication()
{
}
void QGCApplication::deleteAllSettingsNextBoot(void)
{
QSettings settings;
......
......@@ -131,6 +131,8 @@ int main(int argc, char *argv[])
app->_initCommon();
int exitCode;
#ifdef QT_DEBUG
if (runUnitTests) {
if (!app->_initForUnitTests()) {
......@@ -147,13 +149,17 @@ int main(int argc, char *argv[])
{
qDebug() << failures << " TESTS FAILED!";
}
return -failures;
exitCode = -failures;
} else
#endif
{
if (!app->_initForNormalAppBoot()) {
return -1;
}
return app->exec();
exitCode = app->exec();
}
delete app;
return exitCode;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment