eina: fix promise scheduler lookup to find it when given a resolved chain of future.

T6738
This commit is contained in:
Cedric BAIL 2018-03-12 09:43:44 -07:00
parent da798e4528
commit 07e5064e15
1 changed files with 9 additions and 3 deletions

View File

@ -663,9 +663,15 @@ _dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *dead_ptr EINA_UNUSED)
static Eina_Future_Scheduler *
_scheduler_get(Eina_Future *f)
{
for (; f->prev != NULL; f = f->prev);
assert(f->promise != NULL);
return f->promise->scheduler;
do
{
if (f->promise) return f->promise->scheduler;
else if (f->scheduled_entry) return f->scheduled_entry->scheduler;
f = f->prev;
}
while (f);
assert(EINA_FALSE && "no scheduler for future!");
return NULL;
}
EAPI Eina_Value