[client] main: move config free into new config_free method

This commit is contained in:
Geoffrey McRae 2019-03-30 16:00:47 +11:00
parent 4dee965fdf
commit d6805cfa0f
4 changed files with 19 additions and 12 deletions

View File

@ -1 +1 @@
a12-133-g35094a57cb+1 a12-134-g4dee965fdf+1

View File

@ -337,6 +337,21 @@ bool config_load(int argc, char * argv[])
return true; return true;
} }
void config_free()
{
free(params.shmFile );
free(params.spiceHost );
free(params.windowTitle);
for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i)
{
RendererOpts * opts = &params.rendererOpts[i];
for(unsigned int j = 0; j < opts->argc; ++j)
free(opts->argv[j].value);
free(opts->argv);
}
}
static bool load(const char * configFile) static bool load(const char * configFile)
{ {
config_t cfg; config_t cfg;

View File

@ -19,4 +19,5 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <stdbool.h> #include <stdbool.h>
bool config_load(int argc, char * argv[]); bool config_load(int argc, char * argv[]);
void config_free();

View File

@ -1303,15 +1303,6 @@ int main(int argc, char * argv[])
const int ret = run(); const int ret = run();
release_key_binds(); release_key_binds();
free(params.shmFile); config_free();
free(params.spiceHost);
for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i)
{
RendererOpts * opts = &params.rendererOpts[i];
for(unsigned int j = 0; j < opts->argc; ++j)
free(opts->argv[j].value);
free(opts->argv);
}
return ret; return ret;
} }