After some digging, I found out why valgrind was complaining about
memory leaks: creating a main loop using the default glib GMainContext
creates an implicit reference to that context, that needs to be properly
freed. This way, all GSources attached to that context are properly
destroyed.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
state->ctx.errorCode = EXIT_SUCCESS;
state->ctx.mainLoop = g_main_loop_new(gctx, TRUE);
state->ctx.isVMware = VmCheck_IsVirtualWorld();
+ g_main_context_unref(gctx);
g_type_init();
state->ctx.serviceObj = g_object_new(TOOLSCORE_TYPE_SERVICE, NULL);