<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 18, 2015 at 4:24 PM, Alan Coopersmith <span dir="ltr"><<a href="mailto:alan.coopersmith@oracle.com" target="_blank">alan.coopersmith@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/18/15 10:19 AM, Ben Hildred wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Sat, Jul 18, 2015 at 9:42 AM, Alan Coopersmith <<a href="mailto:alan.coopersmith@oracle.com" target="_blank">alan.coopersmith@oracle.com</a><br></span><span class="">
<mailto:<a href="mailto:alan.coopersmith@oracle.com" target="_blank">alan.coopersmith@oracle.com</a>>> wrote:<br>
xcb_setup_roots_iterator just sets up a small structure with pointers to the<br>
list of roots in the xcb_setup_t and the mechanism to walk it without exposing<br>
the structure details to callers.<br>
<br>
<br>
and that explains a lot of the examples, I have seen the walker function too,<br>
but I have not seen a corresponding free function. Does it set up the indexes in<br>
the connection structure or is that fourth line just a small memory leak as only<br>
the data member is used or saved and the structure returned never freed?<br>
</span></blockquote>
<br>
It appears to return a structure, not a pointer to a structure, so callers are<br>
responsible for allocating & freeing space for that structure to be copied into,<br>
and I expect most are doing so on their stack instead of via malloc. (Honestly,<br>
I'd not noticed that bit of it's API before, so I may have misunderstood it.)<span class=""><br>
<br></span></blockquote><div> If it is a structure that is returned then we don't have a memory leak (presuming the compiler can actually pass structures without putting it's foot in it). Thanks for all your help. I have also contributed some to the perl package X11::XCB which is an xcb wrapper that may someday be complete.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
-- <br>
-Alan Coopersmith- <a href="mailto:alan.coopersmith@oracle.com" target="_blank">alan.coopersmith@oracle.com</a><br></span>
Oracle Solaris Engineering - <a href="http://blogs.oracle.com/alanc" rel="noreferrer" target="_blank">http://blogs.oracle.com/alanc</a><br>
</blockquote></div><br>Nice, blog. I have added it to my feed reader.<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>--</div><div><div>Ben Hildred</div><div>Automation Support Services</div></div><div>303 815 6721</div></div>
</div></div>