[appearance] unref the GtkBuilder object if loading failed
Unref the GtkBuilder object if the ui description file could not be loaded. This prevents the GtkBuilder object from being leaked.
This commit is contained in:
parent
91d7627558
commit
dbbe37f0bc
1 changed files with 2 additions and 1 deletions
|
@ -46,7 +46,7 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
|
|||
/* set up the data */
|
||||
uifile = g_build_filename (GNOMECC_GTKBUILDER_DIR, "appearance.ui",
|
||||
NULL);
|
||||
ui = gtk_builder_new();
|
||||
ui = gtk_builder_new ();
|
||||
gtk_builder_add_from_file (ui, uifile, &err);
|
||||
g_free (uifile);
|
||||
|
||||
|
@ -54,6 +54,7 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
|
|||
{
|
||||
g_warning (_("Could not load user interface file: %s"), err->message);
|
||||
g_error_free (err);
|
||||
g_object_unref (ui);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue