eio - don't call cb's after a cancel

i saw a segv in e/efm .. an eio call was called after it had been
canceled. this should never happen. ever. so ensure it does not once
an eio file has been canceled.

@fix
This commit is contained in:
Carsten Haitzler 2019-08-30 12:43:24 +01:00
parent 0e82fa3f40
commit d6156d23d8
1 changed files with 6 additions and 0 deletions

View File

@ -739,6 +739,12 @@ eio_file_cancel(Eio_File *ls)
{
if (!ls) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(ls, EINA_FALSE);
// ensure callbacks are not called aftera cancel otherwise bad things
// happen higher up the stack - you cant stop these being caleld even if
// the dataptr they are passed has been freed or invalidated. being unable
// to stop future cb's and cancel them is BAD.
ls->error_cb = NULL;;
ls->done_cb = NULL;
return ecore_thread_cancel(ls->thread);
}