summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2017-08-02 16:47:11 -0300
committerCedric BAIL <cedric@osg.samsung.com>2017-08-02 16:03:11 -0700
commitc61ac48f1a3647a3010392d44781388fcae6a2a2 (patch)
tree48bd9b8fb1af4e7ac4fb94d67f5f2e46a1a5ea08 /src/lib/ecore
parent470b48d63cfcbd08323634fa395bdbb1b93b8e2d (diff)
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>
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_io_copier.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/ecore/efl_io_copier.c b/src/lib/ecore/efl_io_copier.c
index c43ca0c3b6..0f744d6eb4 100644
--- a/src/lib/ecore/efl_io_copier.c
+++ b/src/lib/ecore/efl_io_copier.c
@@ -100,6 +100,8 @@ _efl_io_copier_job(void *data, const Efl_Event *ev EINA_UNUSED)
100 uint64_t old_total = pd->progress.total; 100 uint64_t old_total = pd->progress.total;
101 101
102 _COPIER_DBG(o, pd); 102 _COPIER_DBG(o, pd);
103 /* FIXME: Remove this wref once efl_promise is able to handle recursive cases. */
104 efl_wref_del(pd->job, &pd->job);
103 pd->job = NULL; /* XXX TODO this should be NULL-ified by efl_promise before calling this function */ 105 pd->job = NULL; /* XXX TODO this should be NULL-ified by efl_promise before calling this function */
104 106
105 efl_ref(o); 107 efl_ref(o);