[PD] when is it necessary to manually free inlets/outlets?

Christof Ressi christof.ressi at gmx.at
Wed Aug 10 14:34:39 CEST 2016


I see, thanks for clarifying! 

Christof

> Gesendet: Mittwoch, 10. August 2016 um 02:22 Uhr
> Von: "Miller Puckette" <msp at ucsd.edu>
> An: "Christof Ressi" <christof.ressi at gmx.at>
> Cc: Pd-List <pd-list at lists.iem.at>
> Betreff: Re: [PD] when is it necessary to manually free inlets/outlets?
>
> I believe the only situation in which you have to free an inlet or outlet
> explicitly is when you're dynamically adding/deleting them from pre-existing
> objects as a result of interior state changes (usually, sub-patches creating/deleting
> them, or on mumber boxes, making or deleting them as a result of the addition or
> not of send/receive names.)  I'm not really sure that was a good idea for number
> boxes.  In short, practically never.
> 
> cheers
> M
> 
> On Tue, Aug 09, 2016 at 03:31:24AM +0200, Christof Ressi wrote:
> > Hi, do you ever actually need to call void inlet_free(t_inlet *x) and void outlet_free(t_outlet *x) explicitly when writing externals?  I'm talking about code like this:
> > 
> > int i=0;
> > for(i=0; i<x->x_numouts; i++) {
> >   outlet_free(x->x_out[i]);
> > }
> > freebytes(x->x_out, x->x_numouts*sizeof(t_outlet*));
> > 
> > I see that you should free the t_outlet* array which holds the references to your outlets but I thought that the outlets itself get deleted automatically when the object's lifetime expires... most of the time I don't see people freeing inlets/outlets, so I was wondering if there are situations where it *is* necessary?
> > 
> > Christof
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Pd-list at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
> 



More information about the Pd-list mailing list