From fae5000f2a067870aea721f4e1200243b298e7b8 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 2 May 2012 04:37:39 +0000 Subject: [PATCH] evas: so we did have a test to check if we could reuse the same map pointer, but instead we did a malloc, a double memcpy and a free. WTH ? SVN revision: 70593 --- legacy/evas/src/lib/canvas/evas_map.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_map.c b/legacy/evas/src/lib/canvas/evas_map.c index 46ac024bbf..640702e907 100644 --- a/legacy/evas/src/lib/canvas/evas_map.c +++ b/legacy/evas/src/lib/canvas/evas_map.c @@ -514,12 +514,9 @@ evas_object_map_set(Evas_Object *obj, const Evas_Map *map) if ((obj->cur.map) && (obj->cur.map->count == map->count)) { - Evas_Map *omap = obj->cur.map; - obj->cur.map = _evas_map_new(map->count); - memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (map->count * sizeof(Evas_Map_Point))); + /* We do have the same exact count of point in this map, so just copy it */ _evas_map_copy(obj->cur.map, map); - if (obj->prev.map == omap) obj->prev.map = NULL; - free(omap); + if (obj->prev.map == obj->cur.map) obj->prev.map = NULL; } else {