Mercurial > audlegacy
diff src/audacious/main.c @ 2369:847213941224 trunk
[svn] - new headless event loop
- fix a memory leak in controlsocket reported by memorypool when using headless mode
author | nenolod |
---|---|
date | Fri, 19 Jan 2007 21:25:46 -0800 |
parents | 85ddfad4f55e |
children | 52bcc18eb8bb |
line wrap: on
line diff
--- a/src/audacious/main.c Fri Jan 19 20:57:49 2007 -0800 +++ b/src/audacious/main.c Fri Jan 19 21:25:46 2007 -0800 @@ -1109,6 +1109,14 @@ } } +static gboolean +aud_headless_iteration(gpointer unused) +{ + audcore_generic_events(); + free_vis_data(); + return TRUE; +} + gint main(gint argc, gchar ** argv) { @@ -1297,18 +1305,16 @@ // if we are running headless else { + GMainLoop *loop; + mainwin_set_info_text(); playlist_start_get_info_thread(); starting_up = FALSE; - while (TRUE) - { - /* headless eventloop */ - audcore_generic_events(); - free_vis_data(); /* to prevent buffer overflow -- paranoia */ - xmms_usleep(10000); - } + loop = g_main_loop_new(NULL, TRUE); + g_timeout_add(10, aud_headless_iteration, NULL); + g_main_loop_run(loop); return EXIT_SUCCESS; }