Skip to content
Snippets Groups Projects
Commit a42b02b2 authored by David Gobbi's avatar David Gobbi
Browse files

Free the wrapper executable options at exit

This makes it easier to track leaks in valgrind.
parent ac0fb52e
Branches
No related tags found
No related merge requests found
......@@ -420,6 +420,26 @@ static int parse_check_options(int argc, char* argv[], int multi)
return i;
}
/* Free memory used by OptionInfo struct, and clear all pointers */
static void parse_free_options(void)
{
free(options.Files);
options.Files = NULL;
options.NumberOfFiles = 0;
options.InputFileName = NULL;
options.OutputFileName = NULL;
options.DependencyFileName = NULL;
free(options.HintFileNames);
options.HintFileNames = NULL;
options.NumberOfHintFileNames = 0;
free(options.HierarchyFileNames);
options.HierarchyFileNames = NULL;
options.NumberOfHierarchyFileNames = 0;
}
/* Return a pointer to the static OptionInfo struct */
const OptionInfo* vtkParse_GetCommandLineOptions(void)
{
......@@ -434,6 +454,7 @@ int vtkParse_FinalizeMain(int ret)
}
vtkParse_FinalizeDependencyTracking();
vtkParse_FreeStringCache(&argv_strings);
parse_free_options();
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment