summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars R. Damerow <[email protected]>2018-07-09 10:19:30 -0700
committerlukefromdc <[email protected]>2018-07-11 19:19:12 -0400
commit78d9182b75bcf0030a5aed54ecaa927ed797a2d0 (patch)
tree141b558389107aa7ba93476bb01bd4ce521c1b9d
parent2d179e43f3cfd3c187b375aa57e2b05a4037124a (diff)
downloadcaja-78d9182b75bcf0030a5aed54ecaa927ed797a2d0.tar.bz2
caja-78d9182b75bcf0030a5aed54ecaa927ed797a2d0.tar.xz
[desktop-bg] Fix memory leak during background change events
The string returned by eel_bg_get_desktop_color() needs to be freed by the caller, which wasn't happening before. Commit b9cf3667 fixed the case where this function was being called repeatedly, triggering this leak and causing it to rapidly fill system memory.
-rw-r--r--libcaja-private/caja-directory-background.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcaja-private/caja-directory-background.c b/libcaja-private/caja-directory-background.c
index 000012fb..02bccb6e 100644
--- a/libcaja-private/caja-directory-background.c
+++ b/libcaja-private/caja-directory-background.c
@@ -323,12 +323,15 @@ desktop_background_changed_cb (EelBackground *background,
static gboolean
desktop_background_prefs_change_event_idle_cb (EelBackground *background)
{
+ gchar *desktop_color = NULL;
+
eel_bg_load_from_gsettings (background,
mate_background_preferences);
- eel_background_set_color (background,
- eel_bg_get_desktop_color (background));
+ desktop_color = eel_bg_get_desktop_color (background);
+ eel_background_set_color (background, desktop_color);
+ g_free(desktop_color);
g_object_unref (background);
return FALSE; /* remove from the list of event sources */