background: Fix a few memory leaks

https://bugzilla.gnome.org/show_bug.cgi?id=757189
This commit is contained in:
Debarshi Ray 2015-10-27 14:35:42 +01:00
parent 98e9f5ac7e
commit c66c73d6ec
2 changed files with 3 additions and 2 deletions

View file

@ -954,6 +954,7 @@ bg_pictures_source_init (BgPicturesSource *self)
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_LOW, priv->cancellable,
dir_enum_async_ready, self);
g_free (cache_path);
priv->cache_dir_monitor = g_file_monitor_directory (dir,
G_FILE_MONITOR_NONE,

View file

@ -289,6 +289,7 @@ on_screenshot_finished (GObject *source,
if (result == NULL) {
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_error_free (error);
g_free (data);
return;
}
g_debug ("Unable to get screenshot: %s",
@ -338,8 +339,6 @@ on_screenshot_finished (GObject *source,
data->monitor_rect.width,
data->monitor_rect.height);
g_free (data);
/* remove the temporary file created by the shell */
g_unlink (panel->priv->screenshot_path);
g_clear_pointer (&priv->screenshot_path, g_free);
@ -349,6 +348,7 @@ on_screenshot_finished (GObject *source,
out:
update_display_preview (panel, WID ("background-desktop-drawingarea"), priv->current_background);
g_free (data);
}
static gboolean