diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2012-06-24 20:04:41 +0000 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2012-06-24 20:04:41 +0000 |
commit | 1f4252160f3ba717e5aef16faaa3be4b8055b31e (patch) | |
tree | 7ac93051c43ee22e3c4d498a641e3cf3d27b2149 /src/instru2light.c | |
parent | 7f75324eb93999c0ea6528b9c1b66740599a1173 (diff) | |
download | 2012-violon-leds-1f4252160f3ba717e5aef16faaa3be4b8055b31e.tar.gz 2012-violon-leds-1f4252160f3ba717e5aef16faaa3be4b8055b31e.tar.bz2 2012-violon-leds-1f4252160f3ba717e5aef16faaa3be4b8055b31e.zip |
Correction segfault a la fermeture si module USB<->DMX non present
git-svn-id: file:///var/svn/2012-violon-leds/trunk@32 6be1fa4d-33ac-4c33-becc-79fcb3794bb6
Diffstat (limited to 'src/instru2light.c')
-rw-r--r-- | src/instru2light.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/instru2light.c b/src/instru2light.c index 33892b5..a72fd0f 100644 --- a/src/instru2light.c +++ b/src/instru2light.c @@ -29,6 +29,8 @@ gint *audio_vumeter_val, *light_h, *light_s, *light_v, *light_r, *light_g, *ligh void my_process(float *data, size_t nsamples, size_t nchan); int main (int argc, char **argv) { + int dmx_init_res; + GtkWidget *mainwin; gint vals_for_vumeters[7]={0,0,0,0,0,0,0}; //sound,h,s,v,r,g,b //Some handy references to the previous array items to make things clear whenever possible @@ -50,7 +52,7 @@ int main (int argc, char **argv) { mainwin=win_main_build(); gtk_widget_show_all (mainwin); - dmx_init(); + dmx_init_res=dmx_init(); printf("debug : main my_process==%p\n", my_process); printf("debug : main (void *)my_process==%p\n", (void *)my_process); @@ -60,7 +62,8 @@ int main (int argc, char **argv) { gtk_main (); gdk_threads_leave(); - dmx_deinit(); + + if (dmx_init_res==0) dmx_deinit(); return 0; } |