forked from enlightenment/efl
ecore: avoid breaking next main loop start if quit occurs outside of loop
in the case where ecore_main_loop_quit() was called before ecore_main_loop_begin(), the latter call would exit immediately without ever iterating the main loop @fix Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9360
This commit is contained in:
parent
d35b06497a
commit
17f433c57b
|
@ -1177,6 +1177,7 @@ _ecore_main_loop_iterate_may_block(Eo *obj, Efl_Loop_Data *pd, int may_block)
|
||||||
void
|
void
|
||||||
_ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
|
_ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
|
||||||
{
|
{
|
||||||
|
pd->loop_active++;
|
||||||
if (obj == ML_OBJ)
|
if (obj == ML_OBJ)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_SYSTEMD
|
||||||
|
@ -1240,11 +1241,13 @@ _ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
|
||||||
pd->do_quit = 0;
|
pd->do_quit = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
pd->loop_active--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_main_loop_quit(Eo *obj, Efl_Loop_Data *pd)
|
_ecore_main_loop_quit(Eo *obj, Efl_Loop_Data *pd)
|
||||||
{
|
{
|
||||||
|
if (!pd->loop_active) return;
|
||||||
pd->do_quit = 1;
|
pd->do_quit = 1;
|
||||||
if (obj != ML_OBJ) return;
|
if (obj != ML_OBJ) return;
|
||||||
#ifdef USE_G_MAIN_LOOP
|
#ifdef USE_G_MAIN_LOOP
|
||||||
|
|
|
@ -163,6 +163,7 @@ struct _Efl_Loop_Data
|
||||||
|
|
||||||
int idlers;
|
int idlers;
|
||||||
int in_loop;
|
int in_loop;
|
||||||
|
unsigned int loop_active;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int high;
|
int high;
|
||||||
|
|
Loading…
Reference in New Issue