summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_promise.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-06-06 02:54:18 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-06 03:09:40 -0300
commit47dea6abc184823df29f4ce0bcdac59aac637bf8 (patch)
tree3ece6c03245ddcc49b0dd5e52cacce36e4206083 /src/tests/ecore/ecore_test_promise.c
parent2a3d7860dbc11458425e162cd69ee399e9025251 (diff)
eina: Avoid promise early deletion when cancelled.
Cancelling a promise will fulfill it but won't actually free the memory. This memory is under custody of the owner, who must either call value_set or error_set to finish it.
Diffstat (limited to 'src/tests/ecore/ecore_test_promise.c')
-rw-r--r--src/tests/ecore/ecore_test_promise.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index 5f2a754..cf9c33f 100644
--- a/src/tests/ecore/ecore_test_promise.c
+++ b/src/tests/ecore/ecore_test_promise.c
@@ -303,7 +303,7 @@ static void promise_cancel_thread(const void* data, Eina_Promise_Owner* promise
303 eina_lock_release(&v->lock); 303 eina_lock_release(&v->lock);
304} 304}
305 305
306static void _cancel_callback(const void* data, Eina_Promise_Owner* promise EINA_UNUSED, Ecore_Thread* thread EINA_UNUSED) 306static void _cancel_callback(const void* data, Eina_Promise_Owner* promise, Ecore_Thread* thread EINA_UNUSED)
307{ 307{
308 _condition_var* v = (void*)data; 308 _condition_var* v = (void*)data;
309 309
@@ -311,6 +311,8 @@ static void _cancel_callback(const void* data, Eina_Promise_Owner* promise EINA_
311 v->boolean = EINA_TRUE; 311 v->boolean = EINA_TRUE;
312 eina_condition_broadcast(&v->condvar); 312 eina_condition_broadcast(&v->condvar);
313 eina_lock_release(&v->lock); 313 eina_lock_release(&v->lock);
314
315 eina_promise_owner_value_set(promise, NULL, NULL);
314} 316}
315 317
316static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value) 318static void _cancel_promise_callback(void* data EINA_UNUSED, Eina_Error value)