[Xcb] to free or not to free

Jamey Sharp jamey at minilop.net
Tue Dec 6 05:56:52 PST 2005

On Tue, Dec 06, 2005 at 10:22:27AM +0100, Vincent Torri wrote:
> just before I return forminfo_iter.data, I free rep. Usually, the data is
> in the chunk of memory of rep. So I guess that my code above is wrong. Am
> I right ? Should I do a memcpy ?

You're right that the code is wrong since forminfo_iter.data is a
pointer into rep, and yes, you should do a memcpy. I'm growing to truly
hate languages without garbage collection.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20051206/844dffef/attachment.pgp

More information about the Xcb mailing list