summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-19 15:42:09 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-07-19 15:04:56 -0700
commit17f433c57bfa11319a22fde1aedb21e99a3a1268 (patch)
tree6ed840b879786833625317adca1fc49e5c38e877 /src/lib/ecore
parentd35b06497a42449d08f976358528016421e085d6 (diff)
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
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_main.c3
-rw-r--r--src/lib/ecore/ecore_private.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 523add2af3..f7d248fc27 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -1177,6 +1177,7 @@ _ecore_main_loop_iterate_may_block(Eo *obj, Efl_Loop_Data *pd, int may_block)
1177void 1177void
1178_ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd) 1178_ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
1179{ 1179{
1180 pd->loop_active++;
1180 if (obj == ML_OBJ) 1181 if (obj == ML_OBJ)
1181 { 1182 {
1182#ifdef HAVE_SYSTEMD 1183#ifdef HAVE_SYSTEMD
@@ -1240,11 +1241,13 @@ _ecore_main_loop_begin(Eo *obj, Efl_Loop_Data *pd)
1240 pd->do_quit = 0; 1241 pd->do_quit = 0;
1241#endif 1242#endif
1242 } 1243 }
1244 pd->loop_active--;
1243} 1245}
1244 1246
1245void 1247void
1246_ecore_main_loop_quit(Eo *obj, Efl_Loop_Data *pd) 1248_ecore_main_loop_quit(Eo *obj, Efl_Loop_Data *pd)
1247{ 1249{
1250 if (!pd->loop_active) return;
1248 pd->do_quit = 1; 1251 pd->do_quit = 1;
1249 if (obj != ML_OBJ) return; 1252 if (obj != ML_OBJ) return;
1250#ifdef USE_G_MAIN_LOOP 1253#ifdef USE_G_MAIN_LOOP
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index b66b50915d..99a3fb7740 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -163,6 +163,7 @@ struct _Efl_Loop_Data
163 163
164 int idlers; 164 int idlers;
165 int in_loop; 165 int in_loop;
166 unsigned int loop_active;
166 167
167 struct { 168 struct {
168 int high; 169 int high;