[gnome-control-center] info: Don't leak GCancellables
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] info: Don't leak GCancellables
- Date: Mon, 28 Aug 2017 16:58:53 +0000 (UTC)
commit 546752f79ebe261dba5c665d50051eabf325e6d2
Author: Rui Matos <tiagomatos gmail com>
Date: Sun Aug 27 19:43:43 2017 +0200
info: Don't leak GCancellables
We were just plainly leaking them and there's really no need since
GCancellable instances can be re-used.
https://bugzilla.gnome.org/show_bug.cgi?id=786097
panels/info/cc-info-overview-panel.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index 7a5879c..0bc3d63 100644
--- a/panels/info/cc-info-overview-panel.c
+++ b/panels/info/cc-info-overview-panel.c
@@ -505,7 +505,6 @@ query_done (GFile *file,
GError *error = NULL;
CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
- priv->cancellable = NULL;
info = g_file_query_filesystem_info_finish (file, res, &error);
if (info != NULL)
{
@@ -548,8 +547,6 @@ get_primary_disc_info_start (CcInfoOverviewPanel *self)
file = g_file_new_for_path (g_unix_mount_get_mount_path (mount));
g_unix_mount_free (mount);
- priv->cancellable = g_cancellable_new ();
-
g_file_query_filesystem_info_async (file,
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,
0,
@@ -602,6 +599,7 @@ get_primary_disc_info (CcInfoOverviewPanel *self)
g_list_free (points);
g_hash_table_destroy (hash);
+ priv->cancellable = g_cancellable_new ();
get_primary_disc_info_start (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]