From: Damien Lespiau Subject: [PATCH i-g-t 4/5] lib: Don't take a reference to the surface in get_cairo_surface() Date: Fri, 11 Jul 2014 15:09:04 +0100 Message-ID: <1405087745-22845-4-git-send-email-damien.lespiau@intel.com> References: <1405087745-22845-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 603F26E00E for ; Fri, 11 Jul 2014 07:09:09 -0700 (PDT) In-Reply-To: <1405087745-22845-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org We don't need to keep a reference to the surface, the cairo context will keep a reference to it until we destroy it. Signed-off-by: Damien Lespiau --- lib/igt_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 83f4343..d07af0d 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -547,7 +547,7 @@ static cairo_surface_t *get_cairo_surface(int fd, struct igt_fb *fb) I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS); - return cairo_surface_reference(fb->cairo_surface); + return fb->cairo_surface; } /** -- 1.8.3.1