[geos-devel] memory leaks in Bigtest

Stefan Zschocke s.zschocke at infozoom.de
Wed Feb 22 10:55:03 EST 2006


I just downloaded and compiled the Geos code. I tried the bigtest sample
and found it leaks memory like hell.
I hate having leaking test programs as it prevents from checking wether
the leak is in the test or the library itself.
First things I did: in the main, make GeometryFactory a local stack
variable, and in run-function delete the 2 polygons after use.
But it still leaks. I assume the leaks result from the code in
GeometryTestFactory.cpp.
Does someone have a clean GeometryTestFactory.cpp, which doesn't leak?

Otherwise I would have to check the code in this file to produce a
non-leaking version.
I already had a look at it, and saw many dynamically-created objects go
into ctors as parameters.
Checked a few and the ctors looked like they needed these objects
permanently, because there were other ctor-overloads with
const-reference parameters, which cloned the const-parms.
But somewhere there must be a fat leak.

Thx, Stefan

BTW: I did the test with VS.Net under XP. I slightly modified the code
to build a GEOS.DLL. Just put a dllExport-macro in the class
declarations, but this would not affect the memory
allocation/deallocation.




More information about the geos-devel mailing list