summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-14 10:12:32 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-15 16:11:39 -0700
commit3b84dbe554a76e2f024b7254c079c761429223ac (patch)
tree0379598d6ba8a1aa1524b6b5d69a7e55e89acdf6
parentf251faa5011ecd26ab000a94d1dd5545949493e5 (diff)
downloadsubsurface-3b84dbe554a76e2f024b7254c079c761429223ac.tar.gz
ssrf: call sync() when exiting appl.
In order to ensure preferences are saved, sync() is called when leaving the program. Signed-off-by: Jan Iversen <jani@apache.org>
-rw-r--r--subsurface-desktop-main.cpp5
-rw-r--r--subsurface-mobile-main.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 5ccd9951c..cec1a159b 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -11,6 +11,7 @@
#include "core/qt-gui.h"
#include "core/qthelper.h"
#include "core/subsurfacestartup.h"
+#include "core/settings/qPref.h"
#include "desktop-widgets/diveplanner.h"
#include "desktop-widgets/mainwindow.h"
#include "desktop-widgets/preferences/preferencesdialog.h"
@@ -118,6 +119,10 @@ int main(int argc, char **argv)
free((void *)default_directory);
free((void *)default_filename);
subsurface_console_exit();
+
+ // Sync struct preferences to disk
+ qPref::sync();
+
free_prefs();
return 0;
}
diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp
index d62314e14..54f5f71d2 100644
--- a/subsurface-mobile-main.cpp
+++ b/subsurface-mobile-main.cpp
@@ -11,6 +11,7 @@
#include "core/qt-gui.h"
#include "core/qthelper.h"
#include "core/subsurfacestartup.h"
+#include "core/settings/qPref.h"
#include <QApplication>
#include <QLocale>
@@ -111,6 +112,10 @@ int main(int argc, char **argv)
taglist_free(g_tag_list);
parse_xml_exit();
subsurface_console_exit();
+
+ // Sync struct preferences to disk
+ qPref::sync();
+
free_prefs();
return 0;
}