summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_map.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-11-24 16:08:45 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-11-24 16:08:45 +0000
commit63cbf85067ddc148c7291077ee8e1f83cdf2ceb0 (patch)
tree2e06fb79d49235d74bbe3eeead62b6fae953268c /src/lib/evas/canvas/evas_map.c
parent575ecb0ea21732d01855dddce569fa1a3cb4d1ef (diff)
eobj changes - protect against null eo data gets.
SVN revision: 79635
Diffstat (limited to 'src/lib/evas/canvas/evas_map.c')
-rw-r--r--src/lib/evas/canvas/evas_map.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index bf5b076..3358b97 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -7,6 +7,7 @@ _evas_map_calc_geom_change(Evas_Object *eo_obj)
7{ 7{
8 int is, was = 0; 8 int is, was = 0;
9 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 9 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
10 if (!obj) return;
10 evas_object_change(eo_obj, obj); 11 evas_object_change(eo_obj, obj);
11 evas_object_clip_dirty(eo_obj, obj); 12 evas_object_clip_dirty(eo_obj, obj);
12 if (!(obj->layer->evas->is_frozen)) 13 if (!(obj->layer->evas->is_frozen))
@@ -37,6 +38,7 @@ _evas_map_calc_map_geometry(Evas_Object *eo_obj)
37 Eina_Bool ch = EINA_FALSE; 38 Eina_Bool ch = EINA_FALSE;
38 39
39 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 40 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
41 if (!obj) return;
40 if (!obj->cur.map) return; 42 if (!obj->cur.map) return;
41 // WARN: Do not merge below code to SLP until it is fixed. 43 // WARN: Do not merge below code to SLP until it is fixed.
42 // It has an infinite loop bug. 44 // It has an infinite loop bug.
@@ -168,7 +170,7 @@ _evas_map_free(Evas_Object *eo_obj, Evas_Map *m)
168 if (eo_obj) 170 if (eo_obj)
169 { 171 {
170 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 172 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
171 if (obj->spans) 173 if ((obj) && (obj->spans))
172 { 174 {
173 obj->layer->evas->engine.func->image_map_clean(obj->layer->evas->engine.data.output, obj->spans); 175 obj->layer->evas->engine.func->image_map_clean(obj->layer->evas->engine.data.output, obj->spans);
174 free(obj->spans); 176 free(obj->spans);
@@ -407,6 +409,7 @@ _evas_object_map_parent_check(Evas_Object *eo_parent)
407 409
408 if (!eo_parent) return EINA_FALSE; 410 if (!eo_parent) return EINA_FALSE;
409 Evas_Object_Protected_Data *parent = eo_data_get(eo_parent, EVAS_OBJ_CLASS); 411 Evas_Object_Protected_Data *parent = eo_data_get(eo_parent, EVAS_OBJ_CLASS);
412 if (!parent) return EINA_FALSE;
410 list = evas_object_smart_members_get_direct(parent->smart.parent); 413 list = evas_object_smart_members_get_direct(parent->smart.parent);
411 EINA_INLIST_FOREACH(list, o) 414 EINA_INLIST_FOREACH(list, o)
412 if (o->cur.usemap) break ; 415 if (o->cur.usemap) break ;
@@ -473,7 +476,8 @@ _map_enable_set(Eo *eo_obj, void *_pd, va_list *list)
473 for (eo_parents = obj->smart.parent; eo_parents; eo_parents = parents->smart.parent) 476 for (eo_parents = obj->smart.parent; eo_parents; eo_parents = parents->smart.parent)
474 { 477 {
475 parents = eo_data_get(eo_parents, EVAS_OBJ_CLASS); 478 parents = eo_data_get(eo_parents, EVAS_OBJ_CLASS);
476 parents->child_has_map = EINA_TRUE; 479 if (parents)
480 parents->child_has_map = EINA_TRUE;
477 } 481 }
478 } 482 }
479 else 483 else
@@ -798,6 +802,7 @@ evas_map_util_points_populate_from_object_full(Evas_Map *m, const Evas_Object *e
798 MAGIC_CHECK_END(); 802 MAGIC_CHECK_END();
799 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 803 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
800 804
805 if (!obj) return;
801 if (m->count != 4) 806 if (m->count != 4)
802 { 807 {
803 ERR("map has count=%d where 4 was expected.", m->count); 808 ERR("map has count=%d where 4 was expected.", m->count);
@@ -818,7 +823,8 @@ evas_map_util_points_populate_from_object(Evas_Map *m, const Evas_Object *eo_obj
818 return; 823 return;
819 MAGIC_CHECK_END(); 824 MAGIC_CHECK_END();
820 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 825 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
821 826
827 if (!obj) return;
822 if (m->count != 4) 828 if (m->count != 4)
823 { 829 {
824 ERR("map has count=%d where 4 was expected.", m->count); 830 ERR("map has count=%d where 4 was expected.", m->count);
@@ -1177,6 +1183,7 @@ evas_object_map_update(Evas_Object *eo_obj,
1177 const Evas_Map_Point *p, *p_end; 1183 const Evas_Map_Point *p, *p_end;
1178 RGBA_Map_Point *pts, *pt; 1184 RGBA_Map_Point *pts, *pt;
1179 1185
1186 if (!obj) return;
1180 if (obj->spans) 1187 if (obj->spans)
1181 { 1188 {
1182 if (obj->spans->x != x || obj->spans->y != y || 1189 if (obj->spans->x != x || obj->spans->y != y ||