[gnome-bluetooth/wip/hadess/btd-restart-fixes: 9/10] settings: Avoid agent re-registration warning




commit 3d165f42e2970759efc1ccc12e7e802bb9915fd8
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Dec 9 00:20:44 2021 +0100

    settings: Avoid agent re-registration warning
    
    When switching back and forth to the Bluetooth panel:
    Failed to register object: An object is already exported for the interface org.bluez.Agent1 at 
/org/gnome/bluetooth/settings

 lib/bluetooth-settings-widget.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 909f399b..27c6a519 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1861,6 +1861,8 @@ bluetooth_settings_widget_finalize (GObject *object)
 {
        BluetoothSettingsWidget *self = BLUETOOTH_SETTINGS_WIDGET(object);
 
+       if (self->agent)
+               bluetooth_agent_unregister (self->agent);
        g_clear_object (&self->agent);
        g_clear_pointer (&self->properties_dialog, gtk_window_destroy);
        g_clear_pointer (&self->pairing_dialog, gtk_window_destroy);


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