summaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-main.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-29 13:21:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-04 09:19:10 -0700
commit7343fe4cc6e364dd3be8f2af4efd9f3a2d748c58 (patch)
tree0308526feddb5ca9b77e5110c3fd1c95857950d2 /subsurface-mobile-main.cpp
parent1e1f33c0f5ea134b832a6ff52086d83d1ef23111 (diff)
downloadsubsurface-7343fe4cc6e364dd3be8f2af4efd9f3a2d748c58.tar.gz
Cleanup: Implicitly free QApplication
Instead of deleting the Application explicitly in exit_ui(), use a unique_ptr to have the instance automatically freed. This is the pattern given in the Qt-docs: https://doc.qt.io/qt-5/qapplication.html Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'subsurface-mobile-main.cpp')
-rw-r--r--subsurface-mobile-main.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp
index 64c941fc7..b75c63406 100644
--- a/subsurface-mobile-main.cpp
+++ b/subsurface-mobile-main.cpp
@@ -53,7 +53,6 @@ void log_stp(const char *ident, QString *buf)
}
#endif // ENABLE_STARTUP_TIMING
-
int main(int argc, char **argv)
{
LOG_STP("main starting");
@@ -63,7 +62,7 @@ int main(int argc, char **argv)
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
// Start application
- new QApplication(argc, argv);
+ std::unique_ptr<QApplication> app(new QApplication(argc, argv));
LOG_STP("main Qt started");
// and get comand line arguments