diff --git a/src/xitk/panel.c b/src/xitk/panel.c --- a/src/xitk/panel.c +++ b/src/xitk/panel.c @@ -28,7 +28,7 @@ #include #include #include - +#include #include "common.h" @@ -360,8 +360,6 @@ static __attribute__((noreturn)) void *s int status, speed; int pos, secs; int i = 0; - - pthread_detach(pthread_self()); while(gGui->on_quit == 0) { @@ -518,6 +516,18 @@ static __attribute__((noreturn)) void *s } /* + * Check if the slider loop has ended + */ +void slider_loop_deinit(void) { + /* For reasons I don't know and I don't wanna know, the slider thread runs detached + * hence is not joinable. We have to poll. + */ + while (pthread_kill(panel->slider_thread, 0) == 0) + xine_usec_sleep(10000); +} + + +/* * Boolean about panel visibility. */ int panel_is_visible(void) { @@ -1055,6 +1065,7 @@ void panel_add_mixer_control(void) { } void panel_deinit(void) { + slider_loop_deinit(); if(panel_is_visible()) _panel_toggle_visibility(NULL, NULL); panel_exit(NULL, NULL); diff --git a/src/xitk/panel.h b/src/xitk/panel.h --- a/src/xitk/panel.h +++ b/src/xitk/panel.h @@ -86,6 +86,7 @@ unsigned long panel_get_tips_timeout(voi void panel_deinit(void); void panel_init (void); +void slider_loop_deinit(void); void panel_change_skins(int);