diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-04-18 11:19:05 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-04-18 11:19:05 -0500 |
commit | 348a5c53f4ca0d1ee197bc0822f0c8d712cd8972 (patch) | |
tree | 250f5113bfe99e37ad5ed067fe8928496c678665 /src/service.c | |
parent | 67218e58889b101ceb5a50bcb40c37045fb2855d (diff) | |
download | ayatana-indicator-session-348a5c53f4ca0d1ee197bc0822f0c8d712cd8972.tar.gz ayatana-indicator-session-348a5c53f4ca0d1ee197bc0822f0c8d712cd8972.tar.bz2 ayatana-indicator-session-348a5c53f4ca0d1ee197bc0822f0c8d712cd8972.zip |
in indicator_session_service_init(), don't leak a GCancellable
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index bcd88ff..14d41cd 100644 --- a/src/service.c +++ b/src/service.c @@ -108,6 +108,7 @@ struct _IndicatorSessionServicePrivate guint rebuild_id; int rebuild_flags; GDBusConnection * conn; + GCancellable * cancellable; gboolean replace; }; @@ -950,9 +951,10 @@ indicator_session_service_init (IndicatorSessionService * self) self->priv = p; /* init the backend objects */ - backend_get (g_cancellable_new (), &p->backend_actions, - &p->backend_users, - &p->backend_guest); + p->cancellable = g_cancellable_new (); + backend_get (p->cancellable, &p->backend_actions, + &p->backend_users, + &p->backend_guest); /* init our key-to-User table */ p->users = g_hash_table_new_full (g_str_hash, @@ -1102,6 +1104,12 @@ my_dispose (GObject * o) unexport (self); + if (p->cancellable != NULL) + { + g_cancellable_cancel (p->cancellable); + g_clear_object (&p->cancellable); + } + if (p->rebuild_id) { g_source_remove (p->rebuild_id); |