summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/render2
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-01 13:09:50 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-01 13:09:50 +0900
commit1585d242da8130d1ed18b12dfa51d0cb3a155470 (patch)
tree814d29e5e8be1457aef06c586068bb1222b73f29 /src/lib/evas/canvas/render2
parentd40b046685263b1a3afec595dc08b91e2dcc9371 (diff)
downloadefl-1585d242da8130d1ed18b12dfa51d0cb3a155470.tar.gz
evas - render2 - silence new gcc warnings about possibly freeing static
This one is new: In file included from lib/evas/canvas/render2/evas_render2.c:5:0: In function ‘_region_break.isra.5’, inlined from ‘region_add’ at lib/evas/canvas/render2/region.c:847:41: lib/evas/canvas/render2/region.c:107:62: warning: attempt to free a non-heap object ‘_region_brokendata’ [-Wfree-nonheap-object] #define FREE_DATA(reg) if ((reg)->data && (reg)->data->size) free((reg)->data) ^ lib/evas/canvas/render2/region.c:184:4: note: in expansion of macro ‘FREE_DATA’ FREE_DATA(region); While it won't actually free is because if using brokendata the size is 0 and it'll skip it, add in a check to see if region->data is the brokendata static
Diffstat (limited to 'src/lib/evas/canvas/render2')
-rw-r--r--src/lib/evas/canvas/render2/region.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/render2/region.c b/src/lib/evas/canvas/render2/region.c
index c2d095e594..864fedcac2 100644
--- a/src/lib/evas/canvas/render2/region.c
+++ b/src/lib/evas/canvas/render2/region.c
@@ -104,7 +104,7 @@ struct _Region
((r1)->y1 <= (r2)->y1) && ((r1)->y2 >= (r2)->y2))
#define ALLOC(n) malloc(PIXREGION_SZOF(n))
-#define FREE_DATA(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
+#define FREE_DATA(reg) if ((reg)->data && ((reg)->data != &_region_brokendata) && (reg)->data->size) free((reg)->data)
#define RECTALLOC_BAIL(pReg ,n, bail) \
if (!(pReg)->data || (((pReg)->data->num + (n)) > (pReg)->data->size)) \
{ \