win: Prevent crash inside ecore evas callbacks
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 11 Aug 2017 01:24:54 +0000 (10:24 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 11 Aug 2017 02:23:21 +0000 (11:23 +0900)
commit39c791dcbc02c84fdc1ad67d8f10e1842872c111
treefbcd78682128ea24ce8b7d3f1d9b2d42e4c1b068
parente2f8ba7ad9d71d7eb6638e92f9c79e9dcb8e9474
win: Prevent crash inside ecore evas callbacks

After any complex call on the window, a foreign evas/efl callback may be
triggered that could delete the window object. This leads to crashes in
queued jobs or even immediately after said callback (right now EO
prevents immediate memory free using eina_freeq or eina_trash so the
effects aren't immediate).

Funnily enough, this was a known issue according to some comments, but
no one bothered fixing it...

In this particular instance, a focus_out job was crashing while trying
to access now-invalid sd data.

I believe some uses of ELM_WIN_DATA_GET() may still be slightly unsafe
but most look like they should be the result of an EO call on the object
(eg. a call to efl_event_callback_call), which ensures the object is
alive.

Fixes T5869
src/lib/elementary/efl_ui_win.c