aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-header-utils.c8
-rw-r--r--widgets/text/e-text.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c
index 16e0a1948c..19a493b0f4 100644
--- a/widgets/table/e-table-header-utils.c
+++ b/widgets/table/e-table-header-utils.c
@@ -290,8 +290,10 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol,
inner_width = button_width - 2 * (xthick + HEADER_PADDING);
inner_height = button_height - 2 * (ythick + HEADER_PADDING);
- if (inner_width < 1 || inner_height < 1)
+ if (inner_width < 1 || inner_height < 1) {
+ cairo_destroy (cr);
return; /* nothing fits */
+ }
inner_x = x + xthick + HEADER_PADDING;
inner_y = y + ythick + HEADER_PADDING;
@@ -314,8 +316,10 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol,
g_return_if_reached ();
}
- if (inner_width < 1)
+ if (inner_width < 1) {
+ cairo_destroy (cr);
return; /* nothing else fits */
+ }
layout = build_header_layout (widget, ecol->text);
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 74c9385012..cbae6d1da8 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1443,8 +1443,10 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
if (!text->preedit_len)
reset_layout (text);
- if (!pango_layout_get_text (text->layout))
+ if (!pango_layout_get_text (text->layout)) {
+ cairo_destroy (cr);
return;
+ }
xpos = text->text_cx;
ypos = text->text_cy;
@@ -1514,6 +1516,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
}
}
}
+
+ cairo_destroy (cr);
}
/* Point handler for the text item */