mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
broadway: Plug another leak
When getting a colorized texture we're downloading the texture as a Cairo surface, and then feeding it to another texture, but we never drop the reference of the new surface.
This commit is contained in:
parent
0b64fa88a1
commit
90be2baf8b
@ -453,7 +453,7 @@ get_colorized_texture (GdkTexture *texture,
|
|||||||
const graphene_matrix_t *color_matrix,
|
const graphene_matrix_t *color_matrix,
|
||||||
const graphene_vec4_t *color_offset)
|
const graphene_vec4_t *color_offset)
|
||||||
{
|
{
|
||||||
cairo_surface_t *surface = gdk_texture_download_surface (texture);
|
cairo_surface_t *surface;
|
||||||
cairo_surface_t *image_surface;
|
cairo_surface_t *image_surface;
|
||||||
graphene_vec4_t pixel;
|
graphene_vec4_t pixel;
|
||||||
guint32* pixel_data;
|
guint32* pixel_data;
|
||||||
@ -475,6 +475,7 @@ get_colorized_texture (GdkTexture *texture,
|
|||||||
return g_object_ref (colorized->texture);
|
return g_object_ref (colorized->texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
surface = gdk_texture_download_surface (texture);
|
||||||
image_surface = cairo_surface_map_to_image (surface, NULL);
|
image_surface = cairo_surface_map_to_image (surface, NULL);
|
||||||
data = cairo_image_surface_get_data (image_surface);
|
data = cairo_image_surface_get_data (image_surface);
|
||||||
width = cairo_image_surface_get_width (image_surface);
|
width = cairo_image_surface_get_width (image_surface);
|
||||||
@ -536,6 +537,8 @@ get_colorized_texture (GdkTexture *texture,
|
|||||||
colorized_list, (GDestroyNotify)colorized_texture_free_list);
|
colorized_list, (GDestroyNotify)colorized_texture_free_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_surface_destroy (surface);
|
||||||
|
|
||||||
return colorized_texture;
|
return colorized_texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user