summaryrefslogtreecommitdiff
path: root/test/user-font-proxy.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-04 13:17:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-04 13:28:37 +0100
commit0fced9279227614ede6964e94ede9de49a3a3388 (patch)
treec03078d3ec68a0582475f089ba2a17d170767e38 /test/user-font-proxy.c
parent38188961b996c97d344195749b7bec8c93f9bad7 (diff)
test/user-font-proxy: Check we install user data on the scaled font
Diffstat (limited to 'test/user-font-proxy.c')
-rw-r--r--test/user-font-proxy.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/user-font-proxy.c b/test/user-font-proxy.c
index 3470a1218..41a69e708 100644
--- a/test/user-font-proxy.c
+++ b/test/user-font-proxy.c
@@ -49,14 +49,20 @@ test_scaled_font_init (cairo_scaled_font_t *scaled_font,
cairo_t *cr,
cairo_font_extents_t *extents)
{
+ cairo_status_t status;
+
cairo_set_font_face (cr,
cairo_font_face_get_user_data (cairo_scaled_font_get_font_face (scaled_font),
&fallback_font_key));
- cairo_scaled_font_set_user_data (scaled_font,
- &fallback_font_key,
- cairo_scaled_font_reference (cairo_get_scaled_font (cr)),
- (cairo_destroy_func_t) cairo_scaled_font_destroy);
+ status = cairo_scaled_font_set_user_data (scaled_font,
+ &fallback_font_key,
+ cairo_scaled_font_reference (cairo_get_scaled_font (cr)),
+ (cairo_destroy_func_t) cairo_scaled_font_destroy);
+ if (unlikely (status)) {
+ cairo_scaled_font_destroy (cairo_get_scaled_font (cr));
+ return status;
+ }
cairo_font_extents (cr, extents);