app: Use g_clear_object() in main.c

Also no need to do a null-check if you're doing g_free(), it can handle
that already.
This commit is contained in:
Niels De Graef 2021-12-17 09:49:05 +01:00
parent b2c715b52b
commit bba495999d

View file

@ -483,11 +483,8 @@ gimp_early_configuration (void)
g_object_unref (earlyrc);
if (system_gimprc_file)
g_object_unref (system_gimprc_file);
if (user_gimprc_file)
g_object_unref (user_gimprc_file);
g_clear_object (&system_gimprc_file);
g_clear_object (&user_gimprc_file);
}
static gboolean
@ -785,14 +782,10 @@ main (int argc,
pdb_compat_mode,
backtrace_file);
if (backtrace_file)
g_free (backtrace_file);
g_free (backtrace_file);
if (system_gimprc_file)
g_object_unref (system_gimprc_file);
if (user_gimprc_file)
g_object_unref (user_gimprc_file);
g_clear_object (&system_gimprc_file);
g_clear_object (&user_gimprc_file);
g_strfreev (argv);