diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index 508d9042ac..563cc37f57 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -527,3 +527,7 @@ * Warn at compile time about forgotten image definition. * Stop compilation when clipping to a non RECT part. + +2012-07-14 Cedric Bail + + * Fix Edje_Multisense shutdown. diff --git a/legacy/edje/NEWS b/legacy/edje/NEWS index a7fc6f4905..00730720d6 100644 --- a/legacy/edje/NEWS +++ b/legacy/edje/NEWS @@ -27,6 +27,7 @@ Fixes: * Fix table and text when fixed point is turned on. * Clamp image tween to never underflow also. * [entry] display preedit string even though there is no attribute + * Fix shutdown of Edje_Multisense. Edje 1.2.0 diff --git a/legacy/edje/src/lib/edje_multisense.c b/legacy/edje/src/lib/edje_multisense.c index 715dc0ca82..4c6fa149c9 100644 --- a/legacy/edje/src/lib/edje_multisense.c +++ b/legacy/edje/src/lib/edje_multisense.c @@ -283,13 +283,17 @@ _player_job(void *data __UNUSED__, Ecore_Thread *th) { if (!msdata->remaining) { - //Cleanup already played sound sources + int err; + + //Cleanup already played sound sources EINA_LIST_FREE(msdata->snd_src_list, sound) { remix_destroy(msdata->msenv->remixenv, sound); } //wait for new sound - select(command_pipe[0] + 1, &wait_fds, NULL, NULL, 0); + err = select(command_pipe[0] + 1, &wait_fds, NULL, NULL, 0); + if (ecore_thread_check(th)) + break; } //read sound command , if any sound_command_handler(msdata); @@ -305,9 +309,6 @@ _player_job(void *data __UNUSED__, Ecore_Thread *th) { remix_destroy(msdata->msenv->remixenv, sound); } - - close(command_pipe[0]); - close(command_pipe[1]); } #endif @@ -400,7 +401,7 @@ _edje_multisense_init(void) if (!msdata) msdata = init_multisense_environment(); if (!player_thread) - player_thread = ecore_thread_run(_player_job, _player_end, _player_cancel, NULL); + player_thread = ecore_thread_feedback_run(_player_job, NULL, _player_end, _player_cancel, NULL, EINA_TRUE); #endif } @@ -408,11 +409,14 @@ void _edje_multisense_shutdown(void) { #ifdef ENABLE_MULTISENSE + if (player_thread) ecore_thread_cancel(player_thread); if (pipe_initialized) { + int i = 42; + + write(command_pipe[1], &i, sizeof (int)); close(command_pipe[1]); close(command_pipe[0]); } - if (player_thread) ecore_thread_cancel(player_thread); #endif }