summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-07-11 11:02:47 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-07-11 11:02:47 -0700
commit3c62a5fab818286dfc23920211d00eb3a3f20938 (patch)
treee5c8d4e314d3f55ca881412928050fe8340d626c /src/lib/ecore
parent231ef8142b7bd9882557a17960631aed1a57acc9 (diff)
ecore: properly cleanup callbacks of future/promise.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_promise.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore/efl_promise.c b/src/lib/ecore/efl_promise.c
index ac0d48d30c..f95e12940e 100644
--- a/src/lib/ecore/efl_promise.c
+++ b/src/lib/ecore/efl_promise.c
@@ -99,7 +99,8 @@ _efl_loop_future_success(Efl_Event *ev, Efl_Loop_Future_Data *pd, void *value)
99 chain_success.value = value; 99 chain_success.value = value;
100 100
101 pd->propagating++; 101 pd->propagating++;
102 EINA_INLIST_FREE(pd->callbacks, cb) 102 // This is done on purpose, we are using cb as a reminder to the head of the list
103 while ((cb = (void*) pd->callbacks))
103 { 104 {
104 // Remove callback early to avoid double execution while 105 // Remove callback early to avoid double execution while
105 // doing recursive call 106 // doing recursive call
@@ -136,7 +137,8 @@ _efl_loop_future_failure(Efl_Event *ev, Efl_Loop_Future_Data *pd, Eina_Error err
136 chain_fail.error = error; 137 chain_fail.error = error;
137 138
138 pd->propagating++; 139 pd->propagating++;
139 EINA_INLIST_FREE(pd->callbacks, cb) 140 // This is done on purpose, we are using cb as a reminder to the head of the list
141 while ((cb = (void*) pd->callbacks))
140 { 142 {
141 // Remove callback early to avoid double execution while 143 // Remove callback early to avoid double execution while
142 // doing recursive call 144 // doing recursive call