forked from enlightenment/efl
ecore: Avoid double free with promises
This commit is contained in:
parent
796b1dd566
commit
fed8123448
|
@ -1574,6 +1574,9 @@ _ecore_main_content_clear(Efl_Loop_Data *pd)
|
|||
EINA_LIST_FREE(tmp, promise)
|
||||
ecore_loop_promise_fulfill(promise);
|
||||
|
||||
// FIXME
|
||||
__eina_promise_cancel_all();
|
||||
|
||||
while (pd->fd_handlers)
|
||||
{
|
||||
Ecore_Fd_Handler *fdh = pd->fd_handlers;
|
||||
|
|
|
@ -824,8 +824,11 @@ _efl_promise_all_free(Efl_Promise_All *all)
|
|||
EINA_ARRAY_ITER_NEXT(&all->members, i, fa, iterator)
|
||||
{
|
||||
if (fa->d)
|
||||
EINA_REFCOUNT_UNREF(fa->d)
|
||||
_efl_promise_msg_free(fa->d);
|
||||
{
|
||||
EINA_REFCOUNT_UNREF(fa->d)
|
||||
_efl_promise_msg_free(fa->d);
|
||||
fa->d = NULL;
|
||||
}
|
||||
}
|
||||
efl_del(all->promise);
|
||||
all->promise = NULL;
|
||||
|
@ -839,8 +842,11 @@ _efl_promise_all_die(void *data, const Efl_Event *ev EINA_UNUSED)
|
|||
|
||||
while ((fa = eina_array_pop(&all->members)))
|
||||
{
|
||||
EINA_REFCOUNT_UNREF(fa->d)
|
||||
_efl_promise_msg_free(fa->d);
|
||||
if (fa->d)
|
||||
{
|
||||
EINA_REFCOUNT_UNREF(fa->d)
|
||||
_efl_promise_msg_free(fa->d);
|
||||
}
|
||||
assert(fa->f == NULL);
|
||||
free(fa);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue