Merge lp:~agateau/libindicate/disconnect-from-dbus into lp:libindicate/0.6

Proposed by Aurélien Gâteau
Status: Merged
Merged at revision: not available
Proposed branch: lp:~agateau/libindicate/disconnect-from-dbus
Merge into: lp:libindicate/0.6
Diff against target: 37 lines
1 file modified
libindicate/listener.c (+13/-0)
To merge this branch: bzr merge lp:~agateau/libindicate/disconnect-from-dbus
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+14419@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote :

This fix bug #462049, which causes Plasma to crash randomly.

I would like to see an SRU for it.

Revision history for this message
Ted Gould (ted) wrote :

On Wed, 2009-11-04 at 13:50 +0000, Aurélien Gâteau wrote:
> This fix bug #462049, which causes Plasma to crash randomly.

Cool. I think we need to g_object_unref the dbus_proxy_session and
system as well. I think there's an object leak there. Thoughts?

Revision history for this message
Neil J. Patel (njpatel) wrote :

Yep, proxy should be g_object_unref'd, and I think dbus_g_connection_unref on priv->session_bus and priv->system_bus too.

341. By Aurélien Gâteau

unref proxies and buses

Revision history for this message
Aurélien Gâteau (agateau) wrote :

> Yep, proxy should be g_object_unref'd, and I think dbus_g_connection_unref on
> priv->session_bus and priv->system_bus too.

Done in r341

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicate/listener.c'
2--- libindicate/listener.c 2009-11-04 14:55:09 +0000
3+++ libindicate/listener.c 2009-11-04 16:37:10 +0000
4@@ -238,6 +238,11 @@
5 {
6 IndicateListener * listener = INDICATE_LISTENER(obj);
7 IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
8+
9+ dbus_g_proxy_disconnect_signal(priv->dbus_proxy_session, "NameOwnerChanged",
10+ G_CALLBACK(dbus_owner_change), listener);
11+ dbus_g_proxy_disconnect_signal(priv->dbus_proxy_system, "NameOwnerChanged",
12+ G_CALLBACK(dbus_owner_change), listener);
13
14 if (priv->todo_idle != 0) {
15 g_idle_remove_by_data(obj);
16@@ -249,6 +254,13 @@
17 g_list_free(priv->proxies_possible);
18 g_list_foreach(priv->proxies_working, (GFunc)proxy_struct_destroy, NULL);
19 g_list_free(priv->proxies_working);
20+
21+ g_object_unref(priv->dbus_proxy_session);
22+ g_object_unref(priv->dbus_proxy_system);
23+
24+ dbus_g_connection_unref(priv->session_bus);
25+ dbus_g_connection_unref(priv->system_bus);
26+
27 G_OBJECT_CLASS (indicate_listener_parent_class)->finalize (obj);
28 return;
29 }
30@@ -281,6 +293,7 @@
31 static void
32 dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateListener * listener)
33 {
34+ g_return_if_fail(INDICATE_IS_LISTENER(listener));
35 IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
36
37 /* If someone is getting on the bus we add them to the

Subscribers

People subscribed via source and target branches