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

View File

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

View File

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

View File

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