changeset 910:5aaf6c282617 trunk

[svn] rootvis: do not call cleanup routines if the plugin was not initted
author giacomo
date Mon, 02 Apr 2007 13:54:59 -0700
parents cb0bb8e6d6e9
children 0010163f8e25
files ChangeLog src/rootvis/rootvis.c
diffstat 2 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Apr 02 10:35:45 2007 -0700
+++ b/ChangeLog	Mon Apr 02 13:54:59 2007 -0700
@@ -1,3 +1,10 @@
+2007-04-02 17:35:45 +0000  Giacomo Lozito <james@develia.org>
+  revision [1918]
+  - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
+  trunk/src/aosd/ghosd.c |   27 ++++++++++++++++++++++++---
+  1 file changed, 24 insertions(+), 3 deletions(-)
+
+
 2007-04-02 11:03:06 +0000  Giacomo Lozito <james@develia.org>
   revision [1916]
   aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded
--- a/src/rootvis/rootvis.c	Mon Apr 02 10:35:45 2007 -0700
+++ b/src/rootvis/rootvis.c	Mon Apr 02 13:54:59 2007 -0700
@@ -19,6 +19,8 @@
 static void rootvis_playback_stop(void);
 static void rootvis_render_freq(gint16 freq_data[2][256]);
 
+static gboolean plugin_is_initted = FALSE;
+
 // Callback functions
 VisPlugin rootvis_vtable = {
 	0, // Handle, filled in by xmms
@@ -409,14 +411,19 @@
 		fprintf(stderr, "Thread creation failed: %d\n", rc1);
 		error_exit("Thread creation failed");
 	}
+  plugin_is_initted = TRUE;
 }
 
 static void rootvis_cleanup(void) {
-	print_status("Cleanup... ");
-	threads.control = STOP;
-	pthread_join(threads.worker[0], NULL);
-	if (conf.stereo)	pthread_join(threads.worker[1], NULL);
-	print_status("Clean Exit");
+  if ( plugin_is_initted )
+  {
+	  print_status("Cleanup... ");
+	  threads.control = STOP;
+	  pthread_join(threads.worker[0], NULL);
+	  if (conf.stereo)	pthread_join(threads.worker[1], NULL);
+	  print_status("Clean Exit");
+    plugin_is_initted = FALSE;
+  }
 }
 
 static void rootvis_about(void)