cemcen / Delynoi

An object-oriented C++ library for the generation of polygonal meshes
18 stars 8 forks source link

Memory leaks due to object initialization in default Mesh() constructor #8

Open ppizarror opened 1 year ago

ppizarror commented 1 year ago

Hi! I found some critical memory leaks using Valgrind, mainly due to the allocation of:

 Mesh<T>::Mesh() {
    this->edges = new SegmentMap;
    this->pointMap = new PointMap;
}

Also, mesh results should be wiped after computing Delaunay/Voronoi. See https://github.com/IE3-CL/Delynoi for the updated version of this library, which includes full support for linux/macos/windows, as well as a new format of include/namespace. For example, https://github.com/IE3-CL/Delynoi/blob/master/Delynoi/src/voronoi/TriangleVoronoiGenerator.cpp#L22-L25 adds clear() method which should be removed after results were processed.

@aaortizb I'm interested to keep maintaining this project :)