forked from enlightenment/efl
Do not allocate Outbuf_Region if we do not need it (leak--).
- If the output buffer has a 'onebuf' and we are going to return that, then we do not need to allocate an Outbuf_Region. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 83161
This commit is contained in:
parent
b07683009a
commit
c4b536e500
|
@ -374,14 +374,9 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
Eina_Rectangle *rect;
|
Eina_Rectangle *rect;
|
||||||
|
|
||||||
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
|
||||||
obr = calloc(1, sizeof(Outbuf_Region));
|
|
||||||
if (!obr) return NULL;
|
|
||||||
rect = eina_rectangle_new(x, y, w, h);
|
rect = eina_rectangle_new(x, y, w, h);
|
||||||
if (!rect)
|
if (!rect) return NULL;
|
||||||
{
|
|
||||||
free(obr);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((eina_array_push(&buf->priv.onebuf_regions, rect)) &&
|
if ((eina_array_push(&buf->priv.onebuf_regions, rect)) &&
|
||||||
(buf->priv.onebuf))
|
(buf->priv.onebuf))
|
||||||
|
@ -397,6 +392,10 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
}
|
}
|
||||||
return buf->priv.onebuf;
|
return buf->priv.onebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obr = calloc(1, sizeof(Outbuf_Region));
|
||||||
|
if (!obr) return NULL;
|
||||||
|
|
||||||
obr->x = 0;
|
obr->x = 0;
|
||||||
obr->y = 0;
|
obr->y = 0;
|
||||||
obr->w = buf->w;
|
obr->w = buf->w;
|
||||||
|
|
Loading…
Reference in New Issue