[PD] data structure setsize allocation

Jonathan Wilkes jancsika at yahoo.com
Tue Nov 11 03:16:47 CET 2014

Hi Miller,
     I think there may be a memory leak regarding [setsize] and your new text field.  The user is initializing and potentially populating many t_binbufs through word_init after they enlarge an array with [setsize].  But if they set a smaller size with [setsize] it doesn't look like you are freeing those t_binbufs.

I noticed this while reworking your old DT_LIST field to create canvases as data fields.  I do [struct test canvas foo bar], which reads an abstraction name bar.pd (if it exists) into a binbuf associated with the corresponding struct.  Then when I create a scalar, it evaluates that t_binbuf which creates a hidden toplevel "bar.pd" canvas.  The fun comes when using the "canvas foo bar" field in a template for an array field-- then I can use [setsize] to create a massive number of abstractions at once.  But when I decrease the array size my abstractions linger until I "vis" them and close them.

So I'm guessing it's the same problem with DT_TEXT, no?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141110/1c923acf/attachment.html>

More information about the Pd-list mailing list