efl_promise: avoid invalid calls when unsetting parent

if promise has no parent then the promise's loop is null

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
This commit is contained in:
Cedric BAIL 2018-03-13 12:08:25 -04:00
parent a1655cf9cb
commit 950e2c13bb
1 changed files with 3 additions and 0 deletions

View File

@ -708,6 +708,9 @@ _efl_promise_efl_object_parent_set(Eo *obj, Efl_Promise_Data *pd, Efl_Object *pa
{
if (!parent) _efl_promise_loop_clear(obj, pd);
efl_parent_set(efl_super(obj, EFL_PROMISE_CLASS), parent);
pd->loop = NULL;
pd->loop_data = NULL;
if (!parent) return;
pd->loop = efl_provider_find(obj, EFL_LOOP_CLASS);
pd->loop_data = efl_data_scope_get(pd->loop, EFL_LOOP_CLASS);
}