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:
Christopher Michael 2013-01-23 11:07:55 +00:00 committed by Christopher Michael
parent b07683009a
commit c4b536e500
1 changed files with 6 additions and 7 deletions

View File

@ -374,14 +374,9 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
Eina_Rectangle *rect;
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);
if (!rect)
{
free(obr);
return NULL;
}
if (!rect) return NULL;
if ((eina_array_push(&buf->priv.onebuf_regions, rect)) &&
(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;
}
obr = calloc(1, sizeof(Outbuf_Region));
if (!obr) return NULL;
obr->x = 0;
obr->y = 0;
obr->w = buf->w;