summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-24 13:52:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-24 15:24:13 +0900
commitd8f59d24c47e72ab77ad4e81e1f04e864bd7cf2e (patch)
treee91cc153ce538bd07f1cc375b46cf11397b59f91
parent1e1a611fdb340be17fef5d6037b0a5c2a80f77ce (diff)
downloadefl-d8f59d24c47e72ab77ad4e81e1f04e864bd7cf2e.tar.gz
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.
-rw-r--r--src/lib/evas/canvas/efl_gfx_map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/efl_gfx_map.c b/src/lib/evas/canvas/efl_gfx_map.c
index 63667cc01f..ab530c3628 100644
--- a/src/lib/evas/canvas/efl_gfx_map.c
+++ b/src/lib/evas/canvas/efl_gfx_map.c
@@ -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));
}