aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-02-21 06:51:15 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-02-21 06:51:15 +0800
commitedefd860d3829426a0b9ce33abbb9e4490357ace (patch)
treeda40378afb03e5af5f5ec5267f7dfdaaa65df2f2 /src
parent1a0c4d402c2eef53366037b75292e9dc32eeb288 (diff)
downloadgsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar.gz
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar.bz2
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar.lz
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar.xz
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.tar.zst
gsoc2013-empathy-edefd860d3829426a0b9ce33abbb9e4490357ace.zip
Also disconnect the approval handler on free if it's still there
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2525
Diffstat (limited to 'src')
-rw-r--r--src/empathy-event-manager.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index ae1932574..adb5e73f9 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -59,8 +59,9 @@ typedef struct {
EmpathyContact *contact;
/* Tube dispatcher if applicable */
EmpathyTubeDispatch *tube_dispatch;
- /* option signal handler */
+ /* option signal handler and it's instance */
gulong handler;
+ GObject *handler_instance;
/* optional accept widget */
GtkWidget *dialog;
} EventManagerApproval;
@@ -124,6 +125,10 @@ event_manager_approval_free (EventManagerApproval *approval)
approval->invalidated_handler);
g_object_unref (approval->operation);
+ if (approval->handler != 0)
+ g_signal_handler_disconnect (approval->handler_instance,
+ approval->handler);
+
if (approval->contact != NULL)
g_object_unref (approval->contact);
@@ -280,7 +285,7 @@ event_text_channel_process_func (EventPriv *event)
{
tp_chat = EMPATHY_TP_CHAT
(empathy_dispatch_operation_get_channel_wrapper (event->approval->operation));
-
+
g_signal_handler_disconnect (tp_chat, event->approval->handler);
event->approval->handler = 0;
}
@@ -622,6 +627,7 @@ event_manager_tube_got_contact_name_cb (EmpathyContact *contact,
approval->handler = g_signal_connect (approval->tube_dispatch,
"notify::dispatchability",
G_CALLBACK (event_manager_tube_dispatch_ability_cb), approval);
+ approval->handler_instance = G_OBJECT (approval->tube_dispatch);
break;
case EMPATHY_TUBE_DISPATCHABILITY_POSSIBLE:
/* fallthrough */
@@ -816,6 +822,7 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
/* 1-1 text channel, wait for the first message */
approval->handler = g_signal_connect (tp_chat, "message-received",
G_CALLBACK (event_manager_chat_message_received_cb), approval);
+ approval->handler_instance = G_OBJECT (tp_chat);
}
else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA))
{