eina: fix memory leak when a Eina_Value as promise is returned, but no dispatching Eina_Future is listening on it.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7652
This commit is contained in:
Cedric BAIL 2019-01-11 17:57:40 -08:00
parent 04c2d313d7
commit 7889f71c7b
1 changed files with 5 additions and 0 deletions

View 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);
}