Efl_Copier: Add efl_wref_del() for pd->job.

In order to perform IO operations the copier will create futures using
efl_future_use(&pd->job, ...), which will set pd->job to NULL once the
future is destroyed. However this may lead to problems, because in some
cases the copier may be deleted at the _efl_io_copier_job() function,
which is the future's callback. Since the copier may be deleted before
the future, the area pointed by pd->job will have disappeared by the time the future
tries to set pd->job to NULL. To avoid this problem the copier must
explicily call efl_wref_del().

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Guilherme Iscaro 2017-08-02 16:47:11 -03:00 committed by Cedric BAIL
parent 470b48d63c
commit c61ac48f1a
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ _efl_io_copier_job(void *data, const Efl_Event *ev EINA_UNUSED)
uint64_t old_total = pd->progress.total;
_COPIER_DBG(o, pd);
/* FIXME: Remove this wref once efl_promise is able to handle recursive cases. */
efl_wref_del(pd->job, &pd->job);
pd->job = NULL; /* XXX TODO this should be NULL-ified by efl_promise before calling this function */
efl_ref(o);