[PD-dev] Destructor in external classes

Funs Seelen funsseelen at gmail.com
Mon Mar 24 18:13:45 CET 2014


Hello IOhannes,

On Mon, Mar 24, 2014 at 2:45 PM, IOhannes m zmölnig <zmoelnig at iem.at> wrote:

>
> the destructor is called "free_method" in Pd-lingo and is set via
> class_new() [1].
>
> so you basically would do:
>
> void myclass_free(t_myclass*x) {
>    free(x->x_ptr);
> }
> // ...
> void myclass_setup(void) {
>   class_new(gensym("myclass"), myclass_new, myclass_free,
> sizeof(t_myclass), 0, ...);
> }
>

Thanks! I now see how it works. You indeed mentioned it in the tutorial.
Sorry for missing that part.

Regards.
Funs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20140324/fea78dc1/attachment-0001.htm>


More information about the Pd-dev mailing list