fix crashes created by "make efl_loop_promise_new a function"
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 25 Dec 2018 13:00:38 +0000 (13:00 +0000)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Thu, 27 Dec 2018 03:35:27 +0000 (12:35 +0900)
commit5ab48fd6e5f25e2fe367a6e7424e8ad3b0314a51
tree8f640952fde9b5724b836555e5bda8ac47db903c
parent1e28565fef452cdf81e5b9d585de390830cbfddf
fix crashes created by "make efl_loop_promise_new a function"

commit 9b5155c9f135f9ef450a817979f5884352b2d4c0 brought about crashes
- specifically that i saw in terminology because it actually uses
eina_promise_data_set() and the new efl_loop_promise_new basically
took over ownership of that data, but if anyone used
eina_promise_data_set() the data ptr used by this new code would bwe
overwritten, causing segfauls when terminology loses selection
ownership. for days i had mysterious crashes of terminology until i
narrowed it down to the above, so if you have too, then this will fix
it.

what this does is create a data set intercept function callback that
for now is only for use inside efl to everride data sets so they set
data inside the new struct that tracks data. i also had to add and
intercept for eina_promise_data_free_cb_set() as this in theory could
also ber a similar problem.

so perhaps the idea/design of efl_loop_promise_new() is not right and
this kind of thgn has to be internal to eina promise... this means
eina promise and loops are much more tied together.
src/lib/ecore/efl_loop_consumer.c
src/lib/eina/eina_promise.c
src/lib/eina/eina_promise.h