forked from AuroraMiddleware/gtk
rendernode: Don't leak mem_surface
This commit is contained in:
parent
657983cfda
commit
af734c4007
@ -1749,6 +1749,7 @@ gsk_cairo_node_serialize (GskRenderNode *node)
|
||||
int width, height;
|
||||
int stride, i;
|
||||
guchar *mem_surface, *data;
|
||||
GVariant *result;
|
||||
|
||||
width = cairo_image_surface_get_width (self->surface);
|
||||
height = cairo_image_surface_get_height (self->surface);
|
||||
@ -1760,7 +1761,7 @@ gsk_cairo_node_serialize (GskRenderNode *node)
|
||||
for (i = 0; i < height; i++)
|
||||
memcpy (mem_surface + i * width * 4, data + i * stride, width * 4);
|
||||
|
||||
return g_variant_new ("(dddduu@au)",
|
||||
result = g_variant_new ("(dddduu@au)",
|
||||
(double) node->bounds.origin.x, (double) node->bounds.origin.y,
|
||||
(double) node->bounds.size.width, (double) node->bounds.size.height,
|
||||
(guint32) width,
|
||||
@ -1769,8 +1770,9 @@ gsk_cairo_node_serialize (GskRenderNode *node)
|
||||
mem_surface,
|
||||
width * height,
|
||||
sizeof (guint32)));
|
||||
|
||||
g_free (mem_surface);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user