Commit 9c85148f authored by Jeremy White's avatar Jeremy White

Add a way to generate valgrind leak suppression files.

This is particularly useful as glib and gtk generally do
not clean up memory.
parent 3be2c110
......@@ -56,3 +56,16 @@ void gui_destroy(gui_t *gui)
/* gtk destroys these windows on exit */
gui->window = NULL;
}
#if defined(GUI_MAIN)
#include <locale.h>
int main(int argc, char *argv[])
{
gui_t gui;
setlocale (LC_ALL, "");
gui_create(&gui, argc, argv, 0, 0);
gui_run(&gui);
gui_destroy(&gui);
}
#endif
......@@ -46,6 +46,10 @@ void options_free(options_t *options)
g_free(options->spice_password);
options->spice_password = NULL;
if (options->autouri)
free(options->autouri);
options->autouri = NULL;
}
......@@ -196,3 +200,16 @@ void options_from_config(options_t *options)
g_debug("options addr '%s', disable_ticketing %d, port %d", options->spice_addr, options->disable_ticketing, options->spice_port);
}
#if defined(OPTIONS_MAIN)
int main(int argc, char *argv[])
{
options_t options;
options_init(&options);
options_parse_arguments(argc, argv, &options);
g_message("Options parsed");
options_from_config(&options);
options_free(&options);
}
#endif
......@@ -15,4 +15,4 @@ noinst_PROGRAMS = $(TESTS)
.PHONY: leakcheck.log
leakcheck.log:
VALGRIND="valgrind --leak-check=full --log-file=leakcheck.log" make check
VALGRIND="valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --suppressions=options.supp --suppressions=gui.supp --log-file=leakcheck.log" make check
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment