[gnome-flashback] system-indicators: fix memory leak
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] system-indicators: fix memory leak
- Date: Tue, 24 Dec 2019 16:00:49 +0000 (UTC)
commit 38eeb5afc978f33ac5143e1a1e5546c85eb99900
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Dec 24 17:53:32 2019 +0200
system-indicators: fix memory leak
system-indicators/si-input-source.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/system-indicators/si-input-source.c b/system-indicators/si-input-source.c
index 138c07c..a433adb 100644
--- a/system-indicators/si-input-source.c
+++ b/system-indicators/si-input-source.c
@@ -617,13 +617,13 @@ property_activate_cb (GtkMenuItem *item,
{
const char *key;
+ key = g_object_get_data (G_OBJECT (item), "key");
+
g_cancellable_cancel (self->cancellable);
+ g_clear_object (&self->cancellable);
- g_object_unref (self->cancellable);
self->cancellable = g_cancellable_new ();
- key = g_object_get_data (G_OBJECT (item), "key");
-
gf_input_sources_gen_call_activate_property (self->input_sources,
key,
self->cancellable,
@@ -957,8 +957,8 @@ changed_cb (GfInputSourcesGen *input_sources,
SiInputSource *self)
{
g_cancellable_cancel (self->cancellable);
+ g_clear_object (&self->cancellable);
- g_object_unref (self->cancellable);
self->cancellable = g_cancellable_new ();
gf_input_sources_gen_call_get_input_sources (self->input_sources,
@@ -1010,6 +1010,9 @@ name_appeared_handler_cb (GDBusConnection *connection,
self = SI_INPUT_SOURCE (user_data);
+ g_cancellable_cancel (self->cancellable);
+ g_clear_object (&self->cancellable);
+
self->cancellable = g_cancellable_new ();
gf_input_sources_gen_proxy_new_for_bus (G_BUS_TYPE_SESSION,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]