1
0
mirror of https://github.com/MidnightCommander/mc synced 2025-01-13 06:49:22 +03:00

Remove extra check before call mc_config_deinit()

...and minor cleanup of related code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-11-04 15:13:41 +03:00
parent 5324bc63bf
commit 4c0ba932a8
3 changed files with 12 additions and 18 deletions
lib
filehighlight
mcconfig
skin

View File

@ -116,13 +116,11 @@ mc_fhl_free (mc_fhl_t ** fhl)
void void
mc_fhl_clear (mc_fhl_t * fhl) mc_fhl_clear (mc_fhl_t * fhl)
{ {
if (fhl == NULL) if (fhl != NULL)
return; {
if (fhl->config)
mc_config_deinit (fhl->config); mc_config_deinit (fhl->config);
mc_fhl_array_free (fhl); mc_fhl_array_free (fhl);
}
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */

View File

@ -131,13 +131,12 @@ mc_config_init (const gchar * ini_path)
void void
mc_config_deinit (mc_config_t * mc_config) mc_config_deinit (mc_config_t * mc_config)
{ {
if (!mc_config) if (mc_config != NULL)
return; {
g_free (mc_config->ini_path); g_free (mc_config->ini_path);
g_key_file_free (mc_config->handle); g_key_file_free (mc_config->handle);
g_free (mc_config); g_free (mc_config);
}
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

View File

@ -149,7 +149,6 @@ mc_skin_init (GError ** error)
void void
mc_skin_deinit (void) mc_skin_deinit (void)
{ {
g_free (mc_skin__default.name); g_free (mc_skin__default.name);
mc_skin__default.name = NULL; mc_skin__default.name = NULL;
g_hash_table_destroy (mc_skin__default.colors); g_hash_table_destroy (mc_skin__default.colors);
@ -158,10 +157,8 @@ mc_skin_deinit (void)
g_free (mc_skin__default.description); g_free (mc_skin__default.description);
mc_skin__default.description = NULL; mc_skin__default.description = NULL;
if (mc_skin__default.config) {
mc_config_deinit (mc_skin__default.config); mc_config_deinit (mc_skin__default.config);
mc_skin__default.config = NULL; mc_skin__default.config = NULL;
}
mc_skin_is_init = FALSE; mc_skin_is_init = FALSE;
} }