background: Fix a few memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=757189
This commit is contained in:
parent
98e9f5ac7e
commit
c66c73d6ec
2 changed files with 3 additions and 2 deletions
|
@ -954,6 +954,7 @@ bg_pictures_source_init (BgPicturesSource *self)
|
||||||
G_FILE_QUERY_INFO_NONE,
|
G_FILE_QUERY_INFO_NONE,
|
||||||
G_PRIORITY_LOW, priv->cancellable,
|
G_PRIORITY_LOW, priv->cancellable,
|
||||||
dir_enum_async_ready, self);
|
dir_enum_async_ready, self);
|
||||||
|
g_free (cache_path);
|
||||||
|
|
||||||
priv->cache_dir_monitor = g_file_monitor_directory (dir,
|
priv->cache_dir_monitor = g_file_monitor_directory (dir,
|
||||||
G_FILE_MONITOR_NONE,
|
G_FILE_MONITOR_NONE,
|
||||||
|
|
|
@ -289,6 +289,7 @@ on_screenshot_finished (GObject *source,
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
g_free (data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_debug ("Unable to get screenshot: %s",
|
g_debug ("Unable to get screenshot: %s",
|
||||||
|
@ -338,8 +339,6 @@ on_screenshot_finished (GObject *source,
|
||||||
data->monitor_rect.width,
|
data->monitor_rect.width,
|
||||||
data->monitor_rect.height);
|
data->monitor_rect.height);
|
||||||
|
|
||||||
g_free (data);
|
|
||||||
|
|
||||||
/* remove the temporary file created by the shell */
|
/* remove the temporary file created by the shell */
|
||||||
g_unlink (panel->priv->screenshot_path);
|
g_unlink (panel->priv->screenshot_path);
|
||||||
g_clear_pointer (&priv->screenshot_path, g_free);
|
g_clear_pointer (&priv->screenshot_path, g_free);
|
||||||
|
@ -349,6 +348,7 @@ on_screenshot_finished (GObject *source,
|
||||||
|
|
||||||
out:
|
out:
|
||||||
update_display_preview (panel, WID ("background-desktop-drawingarea"), priv->current_background);
|
update_display_preview (panel, WID ("background-desktop-drawingarea"), priv->current_background);
|
||||||
|
g_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue