enable cleaning of internal gdl objects at exit in debug mode #1762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
if gdl is compiled with
-DCMAKE_CXX_FLAGS='-DGDL_DO_ATEXIT=1 ...'
, i.e, ifGDL_DO_ATEXIT
is defined, then gdl will clean up all its objects before exit.This removes a tremendous list of supposed memory leaks as reported by Valgrind or Sanitizers.
To be used in debug mode of course.
Mostly, with the exception of a small list of internal objects that cannot be destroyed before exit (because they share memory with another, destroyed, object) the (still long) list of supposed memory leaks is dues to wxWidgets or other external libraries (probably beacause we do not correctly use their respective cleanup functions).