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>
This commit is contained in:
Lubomir I. Ivanov 2015-10-06 13:10:21 +03:00 committed by Dirk Hohndel
parent e8e6fd40e8
commit 645bc0b46e

View file

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