From: Shinwoo Kim Date: Mon, 25 Feb 2019 05:14:41 +0000 (+0900) Subject: eio: cancel registered future before it's freed X-Git-Tag: submit/tizen/20190225.055416^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e858f21654e4473cfd1980a22ccaa977a03d5bd;p=platform%2Fupstream%2Fefl.git eio: cancel registered future before it's freed This is tizen only patch to solve TC issue quickliy For more information, please refer to following upstream patch under reivew. https://phab.enlightenment.org/D7970 This patch would be reverted when corrected patch is merged. @tizen_only Change-Id: I63e9faf43a848d597433fb0a74ab80118a44fa0c --- diff --git a/src/lib/eio/eio_main.c b/src/lib/eio/eio_main.c index cd1471f..d8722d3 100644 --- a/src/lib/eio/eio_main.c +++ b/src/lib/eio/eio_main.c @@ -243,6 +243,8 @@ eio_common_alloc(size_t size) void eio_common_free(Eio_File *common) { + if (common->future) + eina_future_cancel(common->future); free(common); } diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h index a6cd4cc..9075023 100644 --- a/src/lib/eio/eio_private.h +++ b/src/lib/eio/eio_private.h @@ -150,6 +150,7 @@ struct _Eio_File_Char struct _Eio_File { Ecore_Thread *thread; + Eina_Future *future; const void *data; void *container; @@ -556,6 +557,7 @@ _efl_io_manager_future_cancel(Eo *o EINA_UNUSED, void *data, Eina_Error error) static inline Eina_Future * _efl_io_manager_future(const Eo *o, Eina_Future *f, Eio_File *h) { + h->future = f; return efl_future_then(o, f, .error = _efl_io_manager_future_cancel, .data = h);