ooh map bug! bug bug bug! fix! (thanks valgrind)

SVN revision: 55826
This commit is contained in:
Carsten Haitzler 2011-01-03 10:12:17 +00:00
parent ea55cf1bf6
commit f9277782e7
1 changed files with 24 additions and 22 deletions

View File

@ -42,28 +42,29 @@ _evas_map_calc_map_geometry(Evas_Object *obj)
if (!obj->cur.map) return; if (!obj->cur.map) return;
if (obj->prev.map) if (obj->prev.map)
{ {
if (obj->prev.map->count == obj->cur.map->count) // FIXME: this causes an infinite loop somewhere... hard to debug
{ if (obj->prev.map->count == obj->cur.map->count)
const Evas_Map_Point *p2; {
const Evas_Map_Point *p2;
p = obj->cur.map->points;
p_end = p + obj->cur.map->count; p = obj->cur.map->points;
p2 = obj->prev.map->points; p_end = p + obj->cur.map->count;
p2 = obj->prev.map->points;
for (; p < p_end; p++, p2++)
if (p->a != p2->a || for (; p < p_end; p++, p2++)
p->r != p2->r || {
p->g != p2->g || if ((p->a != p2->a) ||
p->b != p2->b) (p->r != p2->r) ||
{ (p->g != p2->g) ||
ch = 1; (p->b != p2->b))
break; {
} ch = 1;
} break;
else }
{ }
ch = 1; }
} else
ch = 1;
} }
p = obj->cur.map->points; p = obj->cur.map->points;
@ -482,6 +483,7 @@ evas_object_map_set(Evas_Object *obj, const Evas_Map *map)
obj->cur.map = _evas_map_new(4); obj->cur.map = _evas_map_new(4);
memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (4 * sizeof(Evas_Map_Point))); memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (4 * sizeof(Evas_Map_Point)));
_evas_map_copy(obj->cur.map, map); _evas_map_copy(obj->cur.map, map);
if (obj->prev.map == omap) obj->prev.map = NULL;
free(omap); free(omap);
} }
_evas_map_calc_map_geometry(obj); _evas_map_calc_map_geometry(obj);