summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-10-06 13:10:21 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-06 16:05:15 +0100
commit645bc0b46e3567a53cc54429b2fb1346c1848216 (patch)
treeb959433a0be53e0cc0c578fcc4e594327c428bbd
parente8e6fd40e8b7eacf39e04c896e1f75c85e09207c (diff)
downloadsubsurface-645bc0b46e3567a53cc54429b2fb1346c1848216.tar.gz
main.cpp: manage the default filename/directory on the heap
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 7807b20df..71a998d34 100644
--- a/main.cpp
+++ b/main.cpp
@@ -34,6 +34,9 @@ int main(int argc, char **argv)
(arguments.at(1) == QString("--win32console"));
subsurface_console_init(dedicated_console);
+ const char *default_directory = system_default_directory();
+ const char *default_filename = system_default_filename();
+
for (i = 1; i < arguments.length(); i++) {
QString a = arguments.at(i);
if (a.at(0) == '-') {
@@ -83,6 +86,8 @@ int main(int argc, char **argv)
exit_ui();
taglist_free(g_tag_list);
parse_xml_exit();
+ free((void *)default_directory);
+ free((void *)default_filename);
subsurface_console_exit();
free_prefs();
return 0;