Re: [patch] surface: set image->parent = NULL

Chris Wilson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Wed, Jan 30, 2013 at 08:13:19PM +0000, Henry (Yu) Song - SISA wrote:
> Please discard previous submitted patch, this patch is better.  Please review
> 
> From 3ec142e09018dc6a58f16c325fe77091e6d086c3 Mon Sep 17 00:00:00 2001
> From: Henry Song <[email protected]>
> Date: Wed, 30 Jan 2013 08:29:06 -0800
> Subject: [PATCH 1/2] surface: increase reference count for parent of cloned
>  image
> 
> If an image surface is created as result of
> _cairo_image_surface_clone_subimage() during either
> private call _cairo_surface_map_to_image() or
> public call cairo_surface_map_to_image(),
> we need to increase reference count of its parent to account for
> parent's reference count descrease when image is destroyed

Hmm, I'd like for the image surface from map-to-image to always hold a
reference on the parent surface - that would trivially prevent one easy
user error and would be prudent in cases were the resultant image
surface is indeed a direct pointer into its parent's resources.

Failing that, I settled for a slightly smaller patch to fixup the
referencing counting in _cairo_image_surface_clone_subimage().

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.