From: Paul Brossier Date: Thu, 16 Mar 2006 15:47:59 +0000 (+0000) Subject: add free function X-Git-Tag: bzr2git~733 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=845f2d40e4b30b735d2364188ae9cef27c7eea33;p=aubio.git add free function add free function --- diff --git a/plugins/puredata/aubiopitch~.c b/plugins/puredata/aubiopitch~.c index effd1212..3a088cb0 100644 --- a/plugins/puredata/aubiopitch~.c +++ b/plugins/puredata/aubiopitch~.c @@ -12,7 +12,7 @@ char aubiopitch_version[] = "aubiopitch~ version 0.1"; -aubio_pitchdetection_type type_pitch = aubio_pitch_mcomb; // aubio_pitch_mcomb +aubio_pitchdetection_type type_pitch = aubio_pitch_mcomb; aubio_pitchdetection_mode mode_pitch = aubio_pitchm_freq; static t_class *aubiopitch_tilde_class; @@ -89,11 +89,19 @@ static void *aubiopitch_tilde_new (void) return (void *)x; } +static void *aubiopitch_tilde_del(t_aubiopitch_tilde *x) +{ + del_aubio_pitchdetection(x->o); + del_fvec(x->vec); + return 0; +} + void aubiopitch_tilde_setup (void) { aubiopitch_tilde_class = class_new (gensym ("aubiopitch~"), (t_newmethod)aubiopitch_tilde_new, - 0, sizeof (t_aubiopitch_tilde), + (t_method)aubiopitch_tilde_del, + sizeof (t_aubiopitch_tilde), CLASS_DEFAULT, A_DEFFLOAT, 0); class_addmethod(aubiopitch_tilde_class, (t_method)aubiopitch_tilde_dsp,