changeset 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 741023a8efa5
children ebe01d05f1dc
files ChangeLog src/audacious/controlsocket.c src/audacious/main.c
diffstat 3 files changed, 58 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jan 19 20:57:49 2007 -0800
+++ b/ChangeLog	Fri Jan 19 21:25:46 2007 -0800
@@ -1,3 +1,44 @@
+2007-01-20 04:57:49 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [3746]
+  - update POTFILES
+  - run make update-po
+  - update welsh translation:
+    462 strings (0 fuzzy, 0 not translated, 0 bad tokens)
+  
+  trunk/po/POTFILES.in   |    1 
+  trunk/po/audacious.pot | 1004 +++++++++++++++++-------------------
+  trunk/po/bg.po         | 1336 ++++++++++++++++++++++++-------------------------
+  trunk/po/br.po         | 1050 ++++++++++++++++++--------------------
+  trunk/po/cs.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/cy.po         | 1190 +++++++++++++++++++++----------------------
+  trunk/po/de.po         | 1034 ++++++++++++++++++-------------------
+  trunk/po/el.po         | 1053 +++++++++++++++++++-------------------
+  trunk/po/es.po         | 1033 ++++++++++++++++++-------------------
+  trunk/po/fi.po         | 1052 +++++++++++++++++++-------------------
+  trunk/po/fr.po         | 1040 ++++++++++++++++++--------------------
+  trunk/po/hi.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/hu.po         | 1034 ++++++++++++++++++-------------------
+  trunk/po/it.po         | 1055 +++++++++++++++++++-------------------
+  trunk/po/ja.po         | 1053 +++++++++++++++++++-------------------
+  trunk/po/ka.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/ko.po         | 1050 ++++++++++++++++++--------------------
+  trunk/po/lt.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/mk.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/nl.po         | 1040 ++++++++++++++++++--------------------
+  trunk/po/pl.po         | 1037 ++++++++++++++++++--------------------
+  trunk/po/pt_BR.po      | 1050 ++++++++++++++++++--------------------
+  trunk/po/ro.po         | 1034 ++++++++++++++++++-------------------
+  trunk/po/ru.po         | 1034 ++++++++++++++++++-------------------
+  trunk/po/sk.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/sr.po         | 1040 ++++++++++++++++++--------------------
+  trunk/po/sr@Latn.po    | 1040 ++++++++++++++++++--------------------
+  trunk/po/sv.po         | 1050 ++++++++++++++++++--------------------
+  trunk/po/uk.po         | 1047 ++++++++++++++++++--------------------
+  trunk/po/zh_CN.po      | 1040 ++++++++++++++++++--------------------
+  trunk/po/zh_TW.po      | 1040 ++++++++++++++++++--------------------
+  31 files changed, 15694 insertions(+), 16025 deletions(-)
+
+
 2007-01-19 23:05:01 +0000  Michael Farber <01mf02@gmail.com>
   revision [3744]
   fix a stupid bug of mine
--- a/src/audacious/controlsocket.c	Fri Jan 19 20:57:49 2007 -0800
+++ b/src/audacious/controlsocket.c	Fri Jan 19 21:25:46 2007 -0800
@@ -778,6 +778,10 @@
              * never return anyway, so this will
              * work ok.
              */
+	    if (pkt->data)
+	        memory_pool_release(cs_pool, pkt->data);
+            memory_pool_release(cs_pool, pkt);
+
             g_mutex_unlock(packet_list_mutex);
             mainwin_quit_cb();
             break;
--- 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;
     }