evas/render: fix log ptr access in render thread

when this lock is released, the evas may be immediately freed, leading to
invalid access in the log call

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11536
This commit is contained in:
Mike Blumenkrantz 2020-03-18 12:29:21 -04:00 committed by Marcel Hollerbach
parent 41299c2b09
commit e4ecb159e7
1 changed files with 4 additions and 1 deletions

View File

@ -3943,9 +3943,11 @@ evas_render_pipe_wakeup(void *data)
Render_Updates *ru;
Evas_Public_Data *evas = data;
Efl_Canvas_Output *out;
Evas *e;
eina_evlog("+render_pipe_wakeup", evas->evas, 0.0, NULL);
eina_spinlock_take(&(evas->render.lock));
e = evas->evas;
EINA_LIST_FOREACH(evas->outputs, ll, out)
{
if (!out->output) continue ;
@ -3967,7 +3969,8 @@ evas_render_pipe_wakeup(void *data)
}
eina_spinlock_release(&(evas->render.lock));
evas_async_events_put(data, 0, NULL, evas_render_async_wakeup);
eina_evlog("-render_pipe_wakeup", evas->evas, 0.0, NULL);
/* use local pointer to avoid data race with 'evas' deref after releasing lock */
eina_evlog("-render_pipe_wakeup", e, 0.0, NULL);
}
EAPI void