mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 19:38:02 +02:00
[test/text-transform] Fix pattern leak.
Add missing cairo_pattern_destroy.
This commit is contained in:
parent
37c69c0d54
commit
b3a70629f8
1 changed files with 4 additions and 6 deletions
|
|
@ -41,9 +41,7 @@ cairo_test_t test = {
|
|||
draw
|
||||
};
|
||||
|
||||
void draw_text (cairo_t *cr);
|
||||
|
||||
void
|
||||
static void
|
||||
draw_text (cairo_t *cr)
|
||||
{
|
||||
cairo_matrix_t tm;
|
||||
|
|
@ -82,9 +80,6 @@ draw (cairo_t *cr, int width, int height)
|
|||
{
|
||||
cairo_pattern_t *pattern;
|
||||
|
||||
pattern = cairo_test_create_pattern_from_png (png_filename);
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
|
||||
|
||||
cairo_set_source_rgb (cr, 1., 1., 1.);
|
||||
cairo_paint (cr);
|
||||
|
||||
|
|
@ -99,7 +94,10 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_translate (cr, SIZE, SIZE);
|
||||
cairo_rotate (cr, M_PI);
|
||||
|
||||
pattern = cairo_test_create_pattern_from_png (png_filename);
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
draw_text (cr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue