[GRASS-user] GRASS API questions- related with free()

Markus Metz markus.metz.giswork at googlemail.com
Wed Nov 17 03:39:30 EST 2010


Pedro Roma wrote:
> Greetings
> I'm using i.gensigset and I realized that, in  a few variavbles, memory is
> not being released. and those are:
> indx = G_alloc_ivector(nbands);
>  y = G_alloc_matrix(nbands, nbands);
>  col = G_alloc_vector(nbands);
>
> What specific functions, from GRASS APIm can I use to release allocated
> memory for those?

None, because these are static variables [1], memory is allocated only
once and automatically released when the program terminates. Why do
you think the allocated memory should be explicitly released?

Markus M

[1] https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/imagery/i.gensigset/subcluster.c#L520


More information about the grass-user mailing list