summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-09-30 01:00:11 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-09-30 01:00:11 +0300
commit850454563606c026398eed19437ae8d49f11f9ac (patch)
tree28a3b594ce73523088b88cbd8a5cf11525c643b9
parenteab7f5bc8c044e166318e6a29c1ffce3de9e033c (diff)
downloadmetacity-850454563606c026398eed19437ae8d49f11f9ac.tar.gz
ui: fix memory leak when changing theme
g_set_object increments reference count of new_object. https://bugzilla.gnome.org/show_bug.cgi?id=788078
-rw-r--r--src/ui/ui.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index a72bfa47..73082858 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -872,8 +872,9 @@ meta_ui_reload_theme (MetaUI *ui)
theme = load_theme (ui, META_THEME_TYPE_GTK, "Adwaita");
}
- g_set_object (&ui->theme, theme);
- g_assert (ui->theme);
+ g_assert (theme);
+ g_clear_object (&ui->theme);
+ ui->theme = theme;
meta_invalidate_default_icons ();
}