summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-27 06:01:07 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-27 15:05:37 -0700
commit93d21ceac74f7c6fdb5f025e9b65db420fdd5ce8 (patch)
tree1a8d5dad5eaf1ee5359f3b21202df24612794a5e
parent3946f83ff2ab1e3d51e62654dc23df01bd1222c6 (diff)
downloadsubsurface-93d21ceac74f7c6fdb5f025e9b65db420fdd5ce8.tar.gz
correctly load default filename
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--subsurface-mobile-main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp
index e18d40794..a354aa429 100644
--- a/subsurface-mobile-main.cpp
+++ b/subsurface-mobile-main.cpp
@@ -40,6 +40,8 @@ int main(int argc, char **argv)
}
git_libgit2_init();
setup_system_prefs();
+ free((void*)prefs.default_filename);
+ prefs.default_filename = NULL;
if (uiLanguage(0).contains("-US"))
default_prefs.units = IMPERIAL_units;
prefs = default_prefs;
@@ -50,6 +52,8 @@ int main(int argc, char **argv)
loadPreferences();
if (prefs.default_file_behavior == LOCAL_DEFAULT_FILE)
set_filename(prefs.default_filename, true);
+ else
+ set_filename(NULL, true);
// some hard coded settings
prefs.animation_speed = 0; // we render the profile to pixmap, no animations