X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=f2fchat.c;h=00c774ff04600a03b1043ca262ab17d698a27e67;hb=1f9e5dd106300779e6e699c819a48f6165ac4c99;hp=55bdc5a04fde185fd4e09e39addae0f62b16c5fd;hpb=9952158738901f331b9e04939f6fbc3e58be03a5;p=cascardo%2Ff2fchat.git diff --git a/f2fchat.c b/f2fchat.c index 55bdc5a..00c774f 100644 --- a/f2fchat.c +++ b/f2fchat.c @@ -17,16 +17,24 @@ */ #include "friend.h" +#include + +static gboolean quit(gpointer data) +{ + GMainLoop *loop = data; + g_main_loop_quit(loop); + return G_SOURCE_CONTINUE; +} int main(int argc, char **argv) { struct cache *cache; - int out = 0; + GMainLoop *loop; create_cache(&cache); load_cache(cache, "friends.cache"); - while (!out) { - out = 1; - } + loop = g_main_loop_new(g_main_context_default(), TRUE); + g_idle_add(quit, loop); + g_main_loop_run(loop); store_cache(cache, "friends.cache"); destroy_cache(cache); return 0;