diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-08-20 00:07:48 +0800 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-08-20 00:07:48 +0800 |
commit | 8e549e268287120c56eb2dbc25b9d70dadb895f2 (patch) | |
tree | 4799ba258ca61a98981deaaa0bb2ff2934676dc1 /libempathy/empathy-connectivity.c | |
parent | c98e85dcf635914dc66755d6a8560e2d370cfffe (diff) | |
download | gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar.gz gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar.bz2 gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar.lz gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar.xz gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.tar.zst gsoc2013-empathy-8e549e268287120c56eb2dbc25b9d70dadb895f2.zip |
all: save the signal id and use that to disconnect from the signal
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'libempathy/empathy-connectivity.c')
-rw-r--r-- | libempathy/empathy-connectivity.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libempathy/empathy-connectivity.c b/libempathy/empathy-connectivity.c index 82ac9c9cb..8cc1d26bb 100644 --- a/libempathy/empathy-connectivity.c +++ b/libempathy/empathy-connectivity.c @@ -37,6 +37,7 @@ typedef struct { #ifdef HAVE_NM NMClient *nm_client; + gulong state_change_signal_id; #endif gboolean connected; @@ -116,7 +117,8 @@ empathy_connectivity_init (EmpathyConnectivity *connectivity) priv->nm_client = nm_client_new (); if (priv->nm_client != NULL) { - g_signal_connect (priv->nm_client, "notify::" NM_CLIENT_STATE, + priv->state_change_signal_id = g_signal_connect (priv->nm_client, + "notify::" NM_CLIENT_STATE, G_CALLBACK (connectivity_nm_state_change_cb), connectivity); connectivity_nm_state_change_cb (priv->nm_client, NULL, connectivity); @@ -139,8 +141,9 @@ connectivity_finalize (GObject *object) if (priv->nm_client != NULL) { - g_signal_handlers_disconnect_by_func (priv->nm_client, - connectivity_nm_state_change_cb, connectivity); + g_signal_handler_disconnect (priv->nm_client, + priv->state_change_signal_id); + priv->state_change_signal_id = 0; g_object_unref (priv->nm_client); priv->nm_client = NULL; } |