main: add some free calls to free GOptionContext

Free the GOptionContext when we are done parsing it
in termite.cc@main.
This commit is contained in:
Daniel Lockyer 2016-04-27 11:03:29 +01:00 committed by Jelle van der Waa
parent ff93b3e28d
commit f7c0aa54ed
1 changed files with 3 additions and 0 deletions

View File

@ -1501,9 +1501,12 @@ int main(int argc, char **argv) {
if (!g_option_context_parse(context, &argc, &argv, &error)) { if (!g_option_context_parse(context, &argc, &argv, &error)) {
g_printerr("option parsing failed: %s\n", error->message); g_printerr("option parsing failed: %s\n", error->message);
g_clear_error (&error);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
g_option_context_free(context);
if (version) { if (version) {
g_print("termite %s\n", TERMITE_VERSION); g_print("termite %s\n", TERMITE_VERSION);
return EXIT_SUCCESS; return EXIT_SUCCESS;