CmdParser icon indicating copy to clipboard operation
CmdParser copied to clipboard

valgrind detects leaks with still reachable memory

Open Lecrapouille opened this issue 7 years ago • 3 comments

Hi Florian ! I just discovered right now your lib ! Nice work ! It seems to Valgrind that there are missing calls to delete but memory can be released by the OS. I had no time for longer investigations but it seems to me: 1/ that exit() does not let class destructor to be called :( You have to create and call a release() method called by class destructor and to be called manually before your exit(). 2/ disable_help() you call std::vector::erase() but you did not delete the command before.

Lecrapouille avatar Jan 12 '18 20:01 Lecrapouille

Ho, did you look at #14?

FlorianRappl avatar Jan 12 '18 21:01 FlorianRappl

ooops no I did not ! My apologize for this double post :( ! I'll give a try ! Thx

Lecrapouille avatar Jan 13 '18 19:01 Lecrapouille

No worries, maybe we can improve / work out a solution in #14. The exit is not a huge problem in my opinion (the OS will free the space anyway, if exit would not actually exit the situation would be different), but if it can be improved then even better.

FlorianRappl avatar Jan 14 '18 00:01 FlorianRappl