summaryrefslogtreecommitdiff
path: root/test/surface-pattern-big-scale-down.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-01-03 17:33:33 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-01-03 18:01:43 +0000
commitc67d99787cb75cd4d773871675b4201b3bf3d5bf (patch)
treea65f92c7e33028e789dcf4a7ea2adc85effd2101 /test/surface-pattern-big-scale-down.c
parent6a7a07adf98729fc054ea9e7727c5b3c099ae7ee (diff)
downloadcairo-c67d99787cb75cd4d773871675b4201b3bf3d5bf.tar.gz
[test/surface-pattern-big-scaled-down] Kill the surface leaks.
Destroy the surface and pattern after use.
Diffstat (limited to 'test/surface-pattern-big-scale-down.c')
-rw-r--r--test/surface-pattern-big-scale-down.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/surface-pattern-big-scale-down.c b/test/surface-pattern-big-scale-down.c
index d1f818cf7..c938d9982 100644
--- a/test/surface-pattern-big-scale-down.c
+++ b/test/surface-pattern-big-scale-down.c
@@ -81,7 +81,6 @@ draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *surface;
cairo_pattern_t *pat;
- int n;
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_paint (cr);
@@ -90,6 +89,7 @@ draw (cairo_t *cr, int width, int height)
setup_source_surface (surface, SRC_WIDTH, SRC_HEIGHT);
pat = cairo_pattern_create_for_surface (surface);
+ cairo_surface_destroy (surface);
/* We want to draw at a position such that n * SRC_WIDTH * (SRC_WIDTH/16.0) > 32768.
* x = n * 16.
@@ -107,10 +107,15 @@ draw (cairo_t *cr, int width, int height)
/* n = 17 */
draw_n (cr, pat, 16.0, 17);
#else
- for (n = 0; n < 32; n++)
- draw_n (cr, pat, 16.0, n);
+ {
+ int n;
+ for (n = 0; n < 32; n++)
+ draw_n (cr, pat, 16.0, n);
+ }
#endif
+ cairo_pattern_destroy (pat);
+
return CAIRO_TEST_SUCCESS;
}