[GRASS-dev] Memory freeing errors in NVIZ (bug 4246)

Cedric Shock cedricgrass at shockfamily.net
Thu May 25 14:00:33 EDT 2006


Hamish,

I just fixed your keyframe bug in CVS. I didn't close the bug because it 
mentions other pieces of the nviz code that do the same thing (something 
about draw.c).

Memory allocated by Tcl must be freed using Tcl_Free. This is the same thing 
that was the nviz segfault on startup bug. Tcl 8.4 is the first version that 
takes advantage of tcl's memory management abstraction, which has been in 
place since at least 7.0. Tcl_Alloc and Tcl_Free just happened to be malloc 
an free on all platforms before 8.4. I know I've said this before, but it 
bears repeating.

To further 8.4ify the nviz code we need to find other places where memory 
allocated by Tcl is freed by G_free or glibc free. This isn't a simple task, 
and requires someone familiar with the nviz code. I think I got all of the 
cases of returning a pointer to free or G_free with an interpreter.

--Cedric




More information about the grass-dev mailing list