[gnome-bluetooth/wip/hadess/agent-fixes: 2/3] agent: Avoid agent re-registration warning




commit b7f179805a6be40312e5f61d0d2028887887a23c
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 15 15:25:21 2021 +0100

    agent: Avoid agent re-registration warning
    
    Bluetooth-CRITICAL **: bluetooth_agent_register: assertion 'agent->path != NULL' failed

 lib/bluetooth-agent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index 4e82a74e..47420feb 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -369,6 +369,7 @@ static void bluetooth_agent_finalize(GObject *object)
 
        bluetooth_agent_unregister (agent);
 
+       g_clear_pointer (&agent->path, g_free);
        g_bus_unwatch_name (agent->watch_id);
        g_free (agent->busname);
        g_dbus_node_info_unref (agent->introspection_data);
@@ -536,7 +537,6 @@ gboolean bluetooth_agent_unregister(BluetoothAgent *agent)
                                              NULL, agent_unregister_cb, NULL);
 
        g_clear_object (&agent->agent_manager);
-       g_clear_pointer (&agent->path, g_free);
        g_clear_pointer (&agent->busname, g_free);
 
        if (agent->reg_id > 0) {


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