Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15441
Modified Files: blockmirror~.c blockshuffle~.c blockswap~.c Log Message: proper freeing of allocated buffers
Index: blockswap~.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/blockswap~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** blockswap~.c 25 Jan 2006 16:27:08 -0000 1.3 --- blockswap~.c 21 Jun 2006 11:04:51 -0000 1.4 *************** *** 68,72 **** }
! static void blockswap_helper(void) { post("\n%c blockswap~-object for blockwise-swapping of a signal ", HEARTSYMBOL); --- 68,72 ---- }
! static void blockswap_helper(t_blockswap *x) { post("\n%c blockswap~-object for blockwise-swapping of a signal ", HEARTSYMBOL); *************** *** 76,79 **** --- 76,87 ---- }
+ static void blockswap_free(t_blockswap *x) + { + if(x->blockbuffer){ + freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize); + } + x->blockbuffer=0; + } + static void *blockswap_new(void) {
Index: blockshuffle~.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/blockshuffle~.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** blockshuffle~.c 20 Jun 2006 18:07:24 -0000 1.1 --- blockshuffle~.c 21 Jun 2006 11:04:51 -0000 1.2 *************** *** 30,35 ****
typedef struct _blockshuffle ! { ! t_object x_obj;
t_sample*blockbuf; --- 30,34 ----
typedef struct _blockshuffle ! { t_object x_obj;
t_sample*blockbuf; *************** *** 116,122 **** } static void blockshuffle_free(t_blockshuffle *x){ ! if(x->indices)freebytes(x->indices, x->size); ! if(x->blockbuf)freebytes(x->blockbuf, x->size); ! if(x->shuffle)freebytes(x->shuffle, x->shufflesize); }
--- 115,121 ---- } static void blockshuffle_free(t_blockshuffle *x){ ! if(x->indices) freebytes(x->indices, sizeof(t_int) *x->size); ! if(x->blockbuf)freebytes(x->blockbuf, sizeof(t_sample)*x->size); ! if(x->shuffle) freebytes(x->shuffle, sizeof(t_float) *x->shufflesize); }
Index: blockmirror~.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/blockmirror~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** blockmirror~.c 25 Jan 2006 16:27:08 -0000 1.3 --- blockmirror~.c 21 Jun 2006 11:04:51 -0000 1.4 *************** *** 73,77 **** }
! static void blockmirror_helper(void) { post("\n%c blockmirror~-object for reverting a signal", HEARTSYMBOL); --- 73,77 ---- }
! static void blockmirror_helper(t_blockmirror*x) { post("\n%c blockmirror~-object for reverting a signal", HEARTSYMBOL); *************** *** 80,84 **** post("outlet : signal~"); } ! static void *blockmirror_new(void) { --- 80,89 ---- post("outlet : signal~"); } ! static void blockmirror_free(t_blockmirror*x) ! { ! if(x->blockbuffer) ! freebytes(x->blockbuffer, sizeof(t_float)*x->blocksize); ! x->blockbuffer=0; ! } static void *blockmirror_new(void) { *************** *** 92,97 **** void blockmirror_tilde_setup(void) { ! blockmirror_class = class_new(gensym("blockmirror~"), (t_newmethod)blockmirror_new, 0, ! sizeof(t_blockmirror), 0, A_NULL); class_addmethod(blockmirror_class, nullfn, gensym("signal"), 0); class_addmethod(blockmirror_class, (t_method)blockmirror_dsp, gensym("dsp"), 0); --- 97,103 ---- void blockmirror_tilde_setup(void) { ! blockmirror_class = class_new(gensym("blockmirror~"), (t_newmethod)blockmirror_new, ! (t_method)blockmirror_free, ! sizeof(t_blockmirror), 0, A_NULL); class_addmethod(blockmirror_class, nullfn, gensym("signal"), 0); class_addmethod(blockmirror_class, (t_method)blockmirror_dsp, gensym("dsp"), 0);