eina: fix memory leak when a Eina_Value as promise is returned, but no dispatching...
authorCedric BAIL <cedric.bail@free.fr>
Sat, 12 Jan 2019 01:57:40 +0000 (17:57 -0800)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 24 Jan 2019 05:20:19 +0000 (14:20 +0900)
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7652

src/lib/eina/eina_promise.c

index 1937c17..f2dc9cc 100644 (file)
@@ -635,6 +635,11 @@ _eina_promise_clean_dispatch(Eina_Promise *p, Eina_Value v)
         // This function is called on a promise created with a scheduler, not a continue one.
         _eina_future_dispatch(p->scheduler, f, v);
      }
+   else
+     {
+        // Nobody is going to flush this value if we don't
+        eina_value_flush(&v);
+     }
    eina_mempool_free(_promise_mp, p);
 }