[all] fix numerous memory leaks at application shutdown

This commit is contained in:
Geoffrey McRae
2021-01-24 19:39:00 +11:00
parent 086f73721d
commit 4c1893fe20
5 changed files with 81 additions and 13 deletions

View File

@@ -223,6 +223,12 @@ void option_free(void)
state.options = NULL;
state.oCount = 0;
for(int g = 0; g < state.gCount; ++g)
{
struct OptionGroup * group = &state.groups[g];
if (group->options)
free(group->options);
}
free(state.groups);
state.groups = NULL;
state.gCount = 0;