From d6156d23d8fb2f02b4582da714b8b0ba089fe36a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 30 Aug 2019 12:43:24 +0100 Subject: [PATCH] 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 --- src/lib/eio/eio_file.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/eio/eio_file.c b/src/lib/eio/eio_file.c index 7a46e9b865..d66b035404 100644 --- a/src/lib/eio/eio_file.c +++ b/src/lib/eio/eio_file.c @@ -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); }