forked from AuroraMiddleware/gtk
gskpango: Fix a potential cairo_t leak
The previous early return did not cairo_destroy() it.
This commit is contained in:
parent
e7a326e230
commit
bce4d669ee
@ -234,7 +234,6 @@ gsk_pango_renderer_draw_shape (PangoRenderer *renderer,
|
||||
int y)
|
||||
{
|
||||
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
|
||||
cairo_t *cr;
|
||||
PangoLayout *layout;
|
||||
PangoCairoShapeRendererFunc shape_renderer;
|
||||
gpointer shape_renderer_data;
|
||||
@ -263,17 +262,21 @@ gsk_pango_renderer_draw_shape (PangoRenderer *renderer,
|
||||
|
||||
if (!handled)
|
||||
{
|
||||
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
|
||||
cairo_t *cr;
|
||||
|
||||
layout = pango_renderer_get_layout (renderer);
|
||||
if (!layout)
|
||||
return;
|
||||
|
||||
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
|
||||
shape_renderer = pango_cairo_context_get_shape_renderer (pango_layout_get_context (layout),
|
||||
&shape_renderer_data);
|
||||
|
||||
if (!shape_renderer)
|
||||
return;
|
||||
{
|
||||
cairo_destroy (cr);
|
||||
return;
|
||||
}
|
||||
|
||||
set_color (crenderer, PANGO_RENDER_PART_FOREGROUND, cr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user