Skip to content

Commit 78d9182

Browse files
bitnesslukefromdc
authored andcommitted
[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 b9cf366 fixed the case where this function was being called repeatedly, triggering this leak and causing it to rapidly fill system memory.
1 parent 2d179e4 commit 78d9182

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libcaja-private/caja-directory-background.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,15 @@ desktop_background_changed_cb (EelBackground *background,
323323
static gboolean
324324
desktop_background_prefs_change_event_idle_cb (EelBackground *background)
325325
{
326+
gchar *desktop_color = NULL;
327+
326328
eel_bg_load_from_gsettings (background,
327329
mate_background_preferences);
328330

329-
eel_background_set_color (background,
330-
eel_bg_get_desktop_color (background));
331+
desktop_color = eel_bg_get_desktop_color (background);
332+
eel_background_set_color (background, desktop_color);
331333

334+
g_free(desktop_color);
332335
g_object_unref (background);
333336

334337
return FALSE; /* remove from the list of event sources */

0 commit comments

Comments
 (0)