[PD-dev] How to free memory of t_symbol

Lucas Cordiviola lucarda27 at hotmail.com
Thu Feb 22 13:45:13 CET 2024


hi,

>  free(x_biases_array) doesn't seem to work


i'm not to good at C but you are missing the correct path 
("nameofthestruct"->"nameofthevarible"). like

     free(x->x_biases_array).


--

Mensaje telepatico asistido por maquinas.

On 22/02/2024 06:19, Alexandros Drymonitis wrote:
> I have a data structure with a symbol and an array of symbols that 
> store array names defined as:
>
> ```
> t_symbol **x_weights_arrays;
> t_symbol *x_biases_array;
> ```
>
> When I'm done with them, I want to free the memory, but calling 
> free(x_biases_array) doesn't seem to work, and once called, as soon as 
> I try to do something else in Pd (like unlock the patch and choose an 
> object), Pd crashes.
>
> I have narrowed down the error to freeing these symbols, and I'm sure 
> the crash is not caused by something else. I scanned m_pd.h to see if 
> there is a function to free t_symbol memory, but didn't seem to find 
> anything. This might be something obvious for C-savvy people, but I'm 
> not one, so any advice is welcome.
>
>
>
>
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at lists.iem.at
> https://lists.puredata.info/listinfo/pd-dev





More information about the Pd-dev mailing list