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>
This commit is contained in:
jan Iversen 2018-08-14 10:12:32 +02:00 committed by Dirk Hohndel
parent f251faa501
commit 3b84dbe554
2 changed files with 10 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;
}