ecore: we need to process future and promise before the internal start loop.
authorCedric BAIL <cedric@osg.samsung.com>
Wed, 21 Dec 2016 19:33:10 +0000 (11:33 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 21 Dec 2016 19:36:42 +0000 (11:36 -0800)
src/lib/ecore/ecore_main.c

index d676ae4..640be7d 100644 (file)
@@ -2317,6 +2317,16 @@ _ecore_main_loop_iterate_internal(int once_only)
 
    /* start of the sleeping or looping section */
 start_loop: /*-*************************************************************/
+   /* We could be looping here without exiting the function and we need to
+      process future and promise before the next waiting period. */
+   /* destroy all optional futures */
+   EINA_LIST_FREE(_pending_futures, f)
+     efl_del(f);
+
+   /* and propagate all promise value */
+   EINA_LIST_FREE(_pending_promises, p)
+     ecore_loop_promise_fulfill(p);
+
    /* any timers re-added as a result of these are allowed to go */
    _efl_loop_timer_enable_new();
    /* if we have been asked to quit the mainloop then exit at this point */