fix crashes created by "make efl_loop_promise_new a function"

Authored by raster on Dec 25 2018, 5:00 AM.


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

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.