evas: Fix rare crash in object destruction

The COW object may have not been created if the object could
not be created. Example: a window failed to open because the
engine could not create a surface.
This commit is contained in:
Jean-Philippe Andre 2017-05-24 13:52:13 +09:00
parent 1e1a611fdb
commit d8f59d24c4
1 changed files with 5 additions and 2 deletions

View File

@ -166,8 +166,11 @@ _efl_gfx_map_efl_object_constructor(Eo *eo_obj, Efl_Gfx_Map_Data *pd)
EOLIAN static void
_efl_gfx_map_efl_object_destructor(Eo *eo_obj, Efl_Gfx_Map_Data *pd)
{
_map_ops_clean(eo_obj, pd);
eina_cow_free(gfx_map_cow, (const Eina_Cow_Data **) &pd->cow);
if (pd->cow)
{
_map_ops_clean(eo_obj, pd);
eina_cow_free(gfx_map_cow, (const Eina_Cow_Data **) &pd->cow);
}
efl_destructor(efl_super(eo_obj, MY_CLASS));
}