[PD] data structure setsize allocation

Miller Puckette msp at ucsd.edu
Tue Nov 11 18:01:30 CET 2014

Sure enough... thanks.


On Mon, Nov 10, 2014 at 06:16:47PM -0800, Jonathan Wilkes via Pd-list wrote:
> 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?
> -Jonathan

> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

More information about the Pd-list mailing list