eio: cancel registered future before it's freed 27/200427/2 submit/tizen/20190225.055416
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 25 Feb 2019 05:14:41 +0000 (14:14 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Mon, 25 Feb 2019 05:20:45 +0000 (05:20 +0000)
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

src/lib/eio/eio_main.c
src/lib/eio/eio_private.h

index cd1471f..d8722d3 100644 (file)
@@ -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);
 }
 
index a6cd4cc..9075023 100644 (file)
@@ -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);