bbenligiray / stag

STag: A Stable Fiducial Marker System
MIT License
187 stars 52 forks source link

Memory Leak #21

Open MrIsland opened 2 years ago

MrIsland commented 2 years ago

Hi ! Really a fantastic project! It really makes great progress for my project! But when I was using it, I noticed that the running memory on the server kept growing. I found a memory leak when using the tools "valgrind". Does anyone else meet the same problem? Or just is the problem with the way I used it? Many thanks !!

bbenligiray commented 2 years ago

I'm not aware of such an issue and I suspect it would have already been raised. Leaving the issue open for others to comment.

teigl commented 2 years ago

I faced the same issue. Found that the members EdgeMap and EDLines are not deleted when EDInterface is destroyed. This is also the case for fitPoints of customEllipse. The line is there in the destructor but it is commented out. Fixing these issues solved the memory leak issues for me but I have not tested with a memory checking tool like valgrind. In addition, there are a few places where delete[] is used on a pointer allocated with malloc where free should be used (for instance in the destructor of customEllipse. Allocation of arrays with new is used many places but most places these are deleted with delete, not delete[], which could cause issues.