[gnome-bluetooth] settings: Unregister the pairing agent on exit



commit 193dc5e27c37e59e2e13d25bb2f9d255a612a587
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Dec 7 11:21:14 2013 +0100

    settings: Unregister the pairing agent on exit

 lib/bluetooth-settings-widget.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 7add20d..17352e9 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1580,8 +1580,10 @@ setup_pairing_agent (BluetoothSettingsWidget *self)
        BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (self);
 
        priv->agent = bluetooth_agent_new ();
-       if (bluetooth_agent_register (priv->agent) == FALSE)
+       if (bluetooth_agent_register (priv->agent) == FALSE) {
+               g_clear_object (&priv->agent);
                return;
+       }
 
        g_object_add_weak_pointer (G_OBJECT (priv->agent), (gpointer *) (&priv->agent));
 
@@ -1679,6 +1681,7 @@ bluetooth_settings_widget_finalize (GObject *object)
 {
        BluetoothSettingsWidgetPrivate *priv = BLUETOOTH_SETTINGS_WIDGET_GET_PRIVATE (object);
 
+       g_clear_object (&priv->agent);
        g_clear_pointer (&priv->properties_dialog, gtk_widget_destroy);
        g_clear_pointer (&priv->pairing_dialog, gtk_widget_destroy);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]