diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-08-19 18:51:27 +0800 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-08-19 18:51:27 +0800 |
commit | 394527fe9f0394c41fcf980bba3668d84434040f (patch) | |
tree | 1bf3581e21b2b53e705695cf193f442a32efb5d1 /libempathy/empathy-idle.c | |
parent | c1d7093754507c971b61633f51b7a80f2dcb4c7d (diff) | |
download | gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar.gz gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar.bz2 gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar.lz gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar.xz gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.tar.zst gsoc2013-empathy-394527fe9f0394c41fcf980bba3668d84434040f.zip |
empathy-idle: disconnect from connectivity signals before unreffing
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'libempathy/empathy-idle.c')
-rw-r--r-- | libempathy/empathy-idle.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c index 7757b7bdf..5f38e941b 100644 --- a/libempathy/empathy-idle.c +++ b/libempathy/empathy-idle.c @@ -258,6 +258,22 @@ idle_state_change_cb (EmpathyConnectivity *connectivity, } static void +idle_use_conn_cb (GObject *object, + GParamSpec *pspec, + EmpathyIdle *idle) +{ + EmpathyIdlePriv *priv = GET_PRIV (idle); + + if (!empathy_connectivity_get_use_conn (priv->connectivity)) { + if (priv->saved_state != TP_CONNECTION_PRESENCE_TYPE_UNSET) { + empathy_idle_set_state (idle, priv->saved_state); + } + + priv->saved_state = TP_CONNECTION_PRESENCE_TYPE_UNSET; + } +} + +static void idle_finalize (GObject *object) { EmpathyIdlePriv *priv; @@ -271,6 +287,11 @@ idle_finalize (GObject *object) g_object_unref (priv->gs_proxy); } + g_signal_handlers_disconnect_by_func (priv->connectivity, + idle_state_change_cb, object); + g_signal_handlers_disconnect_by_func (priv->connectivity, + idle_use_conn_cb, object); + g_object_unref (priv->connectivity); idle_ext_away_stop (EMPATHY_IDLE (object)); @@ -430,22 +451,6 @@ empathy_idle_get_actual_presence (EmpathyIdle *idle, GError **error) } static void -idle_use_conn_cb (GObject *object, - GParamSpec *pspec, - EmpathyIdle *idle) -{ - EmpathyIdlePriv *priv = GET_PRIV (idle); - - if (!empathy_connectivity_get_use_conn (priv->connectivity)) { - if (priv->saved_state != TP_CONNECTION_PRESENCE_TYPE_UNSET) { - empathy_idle_set_state (idle, priv->saved_state); - } - - priv->saved_state = TP_CONNECTION_PRESENCE_TYPE_UNSET; - } -} - -static void empathy_idle_init (EmpathyIdle *idle) { GError *error = NULL; |