summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_promise.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-06-03 16:54:38 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-06-03 17:00:12 -0700
commitaf2b0c8629d6cdfd70f6b21b6d06434717bd3373 (patch)
treeeee24a67b9eff7f63aa2ae088f919591d0a2fb46 /src/lib/eina/eina_promise.c
parent2b12aea5e63139ddabab9c1e93d3b052a2100b4c (diff)
eina: protect promise death during callbacks cancel.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_promise.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c
index 7eac26ef4a..8a207f7b51 100644
--- a/src/lib/eina/eina_promise.c
+++ b/src/lib/eina/eina_promise.c
@@ -193,6 +193,7 @@ _eina_promise_cancel_calls(_Eina_Promise_Default_Owner* promise, Eina_Bool call_
193{ 193{
194 _Eina_Promise_Cancel_Cb* callback; 194 _Eina_Promise_Cancel_Cb* callback;
195 195
196 _eina_promise_ref(&promise->promise);
196 EINA_INLIST_FREE(promise->promise.cancel_callbacks, callback) 197 EINA_INLIST_FREE(promise->promise.cancel_callbacks, callback)
197 { 198 {
198 promise->promise.cancel_callbacks = eina_inlist_remove(promise->promise.cancel_callbacks, EINA_INLIST_GET(callback)); 199 promise->promise.cancel_callbacks = eina_inlist_remove(promise->promise.cancel_callbacks, EINA_INLIST_GET(callback));
@@ -207,6 +208,7 @@ _eina_promise_cancel_calls(_Eina_Promise_Default_Owner* promise, Eina_Bool call_
207 { 208 {
208 _eina_promise_then_calls(promise); 209 _eina_promise_then_calls(promise);
209 } 210 }
211 _eina_promise_unref(&promise->promise);
210} 212}
211 213
212static void 214static void