1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 19:46:44 +02:00

added exit_toxic function (for real this time)

This commit is contained in:
Jfreegman
2013-09-11 00:12:03 -04:00
parent 40dcfc82d2
commit f004a4ba82
3 changed files with 18 additions and 13 deletions

View File

@ -354,6 +354,21 @@ static void load_data(Tox *m, char *path)
}
}
void exit_toxic(Tox *m)
{
store_data(m, DATA_FILE);
if (DATA_FILE != NULL)
free(DATA_FILE);
if (SRVLIST_FILE != NULL)
free(SRVLIST_FILE);
tox_kill(m);
endwin();
exit(EXIT_SUCCESS);
}
int main(int argc, char *argv[])
{
char *user_config_dir = get_user_config_dir();
@ -441,8 +456,6 @@ int main(int argc, char *argv[])
draw_active_window(m);
}
tox_kill(m);
free(DATA_FILE);
free(SRVLIST_FILE);
exit_toxic(m);
return 0;
}