Game Development Community

Freeing memory from datablocks

by Daniel Buckmaster · in General Discussion · 04/05/2009 (5:10 am) · 0 replies

I'm not a coder by training, and I haven't read up on Torque's memory manager as much as I could. So sorry if this really is a silly question...

I've got datablocks created in a similar way to ShapeBaseImageData - with a bunch of big arrays of const char*s which are exposed to script, then used to fill in a C++ structure. The large arrays are then unused for the rest of the datablock's life.

I'm guessing that an array of, say, 256 const char* pointers is not going to be a trivial usage of memory, especially when there are multiple arrays of this size, and multiple datablocks. How can I free up this memory after the script arrays have done their job?

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!