tinyows icon indicating copy to clipboard operation
tinyows copied to clipboard

Code Refactoring - Use a generic object free

Open ocourtin opened this issue 13 years ago • 2 comments

On error code exit (mostly), i have to free every allocated objects. This could be a bit painfull/laborious to enumerate every object line by line.

A generic function dealing with an arbitrary number of args and in charge to free them all, could simplify the whole code.

ocourtin avatar Nov 14 '12 21:11 ocourtin

You might want to look at apr pools: http://apr.apache.org/docs/apr/1.4/group__apr__pools.html . brings in a dependency, but simplifies dynamic memory usage

tbonfort avatar Nov 14 '12 21:11 tbonfort

Thanks for this tip Thomas ! Will have to look at it...

For now i don't feel the need to add a dependancy only for memory usage, but maybe this app could also provide several other features... dunno...

ocourtin avatar Nov 14 '12 21:11 ocourtin