efl_io_copier: keep extra ref when calling back from job.

while in a job we do not have the safety of eo holding us alive and
when we call back the user, he may have deleted the object, releasing
both the object and its private data that we're using.

then keep an extra reference, call the methods and release it.
This commit is contained in:
Gustavo Sverzut Barbieri 2016-08-31 11:54:27 -03:00
parent 49ffa2c887
commit 4ee09c5bdb
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,7 @@ _efl_io_copier_job(void *data, void *value EINA_UNUSED)
pd->job = NULL;
_COPIER_DBG(o, pd);
efl_ref(o);
if (pd->source && efl_io_reader_can_read_get(pd->source))
_efl_io_copier_read(o, pd);
@ -92,6 +93,8 @@ _efl_io_copier_job(void *data, void *value EINA_UNUSED)
efl_event_callback_call(o, EFL_IO_COPIER_EVENT_DONE, NULL);
}
}
efl_unref(o);
}
static void