From 164d9d26ac33029287a24fbed549e3a2858d5d51 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Dec 2013 17:48:43 +0000 Subject: kmstest: Fix up lifetimes of cairo objects cairo_t is the short lived drawing context, whereas cairo_surface_t is the heavyweight object that persists and is also tied to underlying GEM objects. So make the kmstest API reflect the different weights and fix the lifetime and underlying object reference leaks. Based on the fix by Paulo Zanoni. Signed-off-by: Chris Wilson --- tests/kms_setmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/kms_setmode.c') diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index e1c9c5a6..c5e86301 100644 --- a/tests/kms_setmode.c +++ b/tests/kms_setmode.c @@ -151,8 +151,6 @@ static int paint_fb(struct kmstest_fb *fb, const char *test_name, int i; cr = kmstest_get_cairo_ctx(drm_fd, fb); - if (!cr) - return -1; kmstest_paint_test_pattern(cr, fb->width, fb->height); @@ -176,6 +174,8 @@ static int paint_fb(struct kmstest_fb *fb, const char *test_name, crtc_str[i]); } + cairo_destroy(cr); + return 0; } -- cgit v1.2.3