-
Notifications
You must be signed in to change notification settings - Fork 598
Open
Labels
Description
Hi,
I'm running Valgrind on a project which use PGV.
The project do not allow any memory leaking even when exiting the program.
In your file validate.h you create a global validator_map on heap.
However this map is never destroyed leading to error in Valgrind complaining at exit of program that it leaked.
In protobuf they provide the ShutdownProtobufLibrary function in order to deallocate every allocated object and makes memory analyzer happy.
For now to temporarly FIX that, I have added the following similar function in BaseValidator in order to cleanup this map and make Valgrind happy with no error:
static void ShutdownValidator() {
delete &abstractValidators();
}
I call this function when my program exit, at the same time of the ShutdownProtobufLibrary function.
Regards