Mercurial > audlegacy-plugins
diff src/rootvis/rootvis.c @ 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 | d985f0dcdeb0 |
| children | 2cf4d0182a86 |
line wrap: on
line diff
--- 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)
