diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 13:17:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 13:28:37 +0100 |
commit | 0fced9279227614ede6964e94ede9de49a3a3388 (patch) | |
tree | c03078d3ec68a0582475f089ba2a17d170767e38 /test | |
parent | 38188961b996c97d344195749b7bec8c93f9bad7 (diff) |
test/user-font-proxy: Check we install user data on the scaled font
Diffstat (limited to 'test')
-rw-r--r-- | test/user-font-proxy.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/user-font-proxy.c b/test/user-font-proxy.c index 3470a121..41a69e70 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); |