[Xcb] xcb_setup_roots_iterator

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jul 18 15:24:39 PDT 2015


On 07/18/15 10:19 AM, Ben Hildred wrote:
> On Sat, Jul 18, 2015 at 9:42 AM, Alan Coopersmith <alan.coopersmith at oracle.com
> <mailto:alan.coopersmith at oracle.com>> wrote:
>     xcb_setup_roots_iterator just sets up a small structure with pointers to the
>     list of roots in the xcb_setup_t and the mechanism to walk it without exposing
>     the structure details to callers.
>
>
> and that explains a lot of the examples, I have seen the walker function too,
> but I have not seen a corresponding free function. Does it set up the indexes in
> the connection structure or is that fourth line just a small memory leak as only
> the data member is used or saved and the structure returned never freed?

It appears to return a structure, not a pointer to a structure, so callers are
responsible for allocating & freeing space for that structure to be copied into,
and I expect most are doing so on their stack instead of via malloc.  (Honestly,
I'd not noticed that bit of it's API before, so I may have misunderstood it.)

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the Xcb mailing list