summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-06-24 04:29:55 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-06-24 04:29:55 -0400
commit5be65318a4cee0c69377973105c9ce86d6d72c81 (patch)
treea08c4b17570fe6460011e048d4b2e868b0939900
parent27a6e38bbf4d132c9be56fbeaaad73cc539089de (diff)
downloadlibnotify-5be65318a4cee0c69377973105c9ce86d6d72c81.tar.gz
Disconnect the proxy destroy signal handler
-rw-r--r--libnotify/notification.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c
index 7ad2acf..b4fcb1e 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -383,6 +383,23 @@ notify_notification_init (NotifyNotification *obj)
}
static void
+on_proxy_destroy (DBusGProxy *proxy,
+ NotifyNotification *notification)
+{
+ if (notification->priv->signals_registered) {
+ dbus_g_proxy_disconnect_signal (proxy,
+ "NotificationClosed",
+ G_CALLBACK (_close_signal_handler),
+ notification);
+ dbus_g_proxy_disconnect_signal (proxy,
+ "ActionInvoked",
+ G_CALLBACK (_action_signal_handler),
+ notification);
+ notification->priv->signals_registered = FALSE;
+ }
+}
+
+static void
notify_notification_finalize (GObject *object)
{
NotifyNotification *obj = NOTIFY_NOTIFICATION (object);
@@ -415,6 +432,10 @@ notify_notification_finalize (GObject *object)
proxy = _notify_get_g_proxy ();
if (proxy != NULL && priv->signals_registered) {
+ g_signal_handlers_disconnect_by_func (proxy,
+ G_CALLBACK (on_proxy_destroy),
+ object);
+
dbus_g_proxy_disconnect_signal (proxy,
"NotificationClosed",
G_CALLBACK (_close_signal_handler),
@@ -749,24 +770,6 @@ _gslist_to_string_array (GSList *list)
return (char **) g_array_free (a, FALSE);
}
-static void
-on_proxy_destroy (DBusGProxy *proxy,
- NotifyNotification *notification)
-{
- if (notification->priv->signals_registered) {
- dbus_g_proxy_disconnect_signal (proxy,
- "NotificationClosed",
- G_CALLBACK (_close_signal_handler),
- notification);
- dbus_g_proxy_disconnect_signal (proxy,
- "ActionInvoked",
- G_CALLBACK (_action_signal_handler),
- notification);
- notification->priv->signals_registered = FALSE;
- }
-}
-
-
/**
* notify_notification_show:
* @notification: The notification.