From: Xavier Claessens Date: Thu, 27 Sep 2007 08:13:51 +0000 (+0000) Subject: No need to init gtk, GMainLoop is enough and makes easier to run valgrind. X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=37a9b435efdb27dad389763a12b9bad185b700d5 No need to init gtk, GMainLoop is enough and makes easier to run valgrind. 2007-09-27 Xavier Claessens * tests/contact-manager.c: * tests/Makefile.am: No need to init gtk, GMainLoop is enough and makes easier to run valgrind. svn path=/trunk/; revision=324 --- diff --git a/ChangeLog b/ChangeLog index a6365bc2..c5df062a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-09-27 Xavier Claessens + + * tests/contact-manager.c: + * tests/Makefile.am: No need to init gtk, GMainLoop is enough and makes + easier to run valgrind. + 2007-09-27 Xavier Claessens * libempathy/empathy-avatar.c: Fix leak when loading avatar from cache. diff --git a/tests/Makefile.am b/tests/Makefile.am index 16358591..8c6094c9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,7 +8,7 @@ LDADD = \ $(top_builddir)/libempathy/libempathy.la \ $(EMPATHY_LIBS) -noinst_PROGRAMS = \ +bin_PROGRAMS = \ contact-manager contact_manager_SOURCES = contact-manager.c diff --git a/tests/contact-manager.c b/tests/contact-manager.c index c9450105..2d10642e 100644 --- a/tests/contact-manager.c +++ b/tests/contact-manager.c @@ -1,12 +1,12 @@ #include -#include +#include #include static gboolean -time_out (gpointer data) +time_out (gpointer main_loop) { - gtk_main_quit (); + g_main_loop_quit (main_loop); return FALSE; } @@ -15,16 +15,20 @@ int main (int argc, char **argv) { EmpathyContactManager *manager; + GMainLoop *main_loop; - gtk_init (&argc, &argv); + g_type_init (); + main_loop = g_main_loop_new (NULL, FALSE); manager = empathy_contact_manager_new (); - g_timeout_add (5000, time_out, NULL); + g_timeout_add (5000, time_out, main_loop); - gtk_main (); + g_main_loop_run (main_loop); g_object_unref (manager); + g_main_loop_unref (main_loop); return EXIT_SUCCESS; } +