aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-03 17:15:10 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-03 17:15:10 +0900
commitd80ef6d7a98e0cb3ceb995573c58d1df965639e4 (patch)
tree7455548842562ed7f2ba3e561567be08c21bf98b
parentecore thread queue tests - reduce size and craziness and fix 1 (diff)
downloadefl-d80ef6d7a98e0cb3ceb995573c58d1df965639e4.tar.gz
efl loop promises - cleare out promise data to null
so there is something broken in the complect efl promise/loop promise that the clear of promises on loop destroy is clearing promises/futures that have already triggered (loop timer ones). i've spent enough time figuring out that it is happening. _efl_loop_timeout_del() simple doenst ensure the future in pending_futures for that promise is removed from the list. getting the future from the promise handle is an exercise in pain... so i'm not continuing with that path and will just ignore it. but for now filling the promise data with null at least means if the menory is re-used after free it wont see garbage freed ptrs and get nulls so its easier to track.
-rw-r--r--src/lib/ecore/efl_loop.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c
index 0ccee1706f..b3a58f9ae9 100644
--- a/src/lib/ecore/efl_loop.c
+++ b/src/lib/ecore/efl_loop.c
@@ -488,7 +488,10 @@ static void
_efl_loop_idle_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED)
{
Efl_Loop_Promise_Simple_Data *d = data;
+
ecore_idler_del(d->idler);
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
}
@@ -497,6 +500,8 @@ _efl_loop_idle_done(void *data)
{
Efl_Loop_Promise_Simple_Data *d = data;
eina_promise_resolve(d->promise, EINA_VALUE_EMPTY);
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return EINA_FALSE;
}
@@ -523,6 +528,8 @@ _efl_loop_idle(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED)
return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));
idler_error:
+ d->idler = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return NULL;
}
@@ -552,6 +559,7 @@ _efl_loop_timeout_del(void *data, const Efl_Event *event EINA_UNUSED)
Efl_Loop_Promise_Simple_Data *d = data;
d->timer = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
}
@@ -585,6 +593,8 @@ _efl_loop_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double tim)
return efl_future_Eina_FutureXXX_then(obj, eina_future_new(p));
timer_error:
+ d->timer = NULL;
+ d->promise = NULL;
efl_loop_promise_simple_data_mp_free(d);
return NULL;
}
@@ -759,7 +769,6 @@ _env_sync(Efl_Loop_Data *pd, Efl_Task_Data *td)
{
if (pd->env.environ_copy[i] != environ[i])
{
- printf(" env %i mismatch\n", i);
update = EINA_TRUE;
break;
}