forked from enlightenment/efl
ecore_evas: prevent double free evas.
When user manually free the ecore evas, it could delete evas internally, then evas_invalidate would be triggered, invalidate callback would try free evas again, this causes double free evas. TEST SCENARIO: ee = ecore_evas_new(...); ... ecore_evas_free(ee); -> free evas -> invalidated cb -> free evas (**double free)
This commit is contained in:
parent
0a0f559d5a
commit
c015b9d92c
|
@ -3502,7 +3502,11 @@ _ecore_evas_free(Ecore_Evas *ee)
|
|||
ee->prop.wm_rot.manual_mode.timer = NULL;
|
||||
eina_hash_free(ee->prop.cursors);
|
||||
ee->prop.cursors = NULL;
|
||||
if (!ee->evas_dying) evas_free(ee->evas);
|
||||
if (!ee->evas_dying)
|
||||
{
|
||||
ee->evas_dying = EINA_TRUE;
|
||||
evas_free(ee->evas);
|
||||
}
|
||||
ee->evas = NULL;
|
||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
|
||||
ee->driver = NULL;
|
||||
|
@ -5276,6 +5280,7 @@ static void
|
|||
_ecore_evas_event_del(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Ecore_Evas *ee = data;
|
||||
if (ee->evas_dying) return;
|
||||
|
||||
ee->evas_dying = EINA_TRUE;
|
||||
ecore_evas_free(ee);
|
||||
|
|
Loading…
Reference in New Issue