mesh: Remove agent when freeing node's dynamic resources 15/235115/1
authorInga Stotland <inga.stotland@intel.com>
Fri, 22 May 2020 00:34:54 +0000 (17:34 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Thu, 28 May 2020 11:27:22 +0000 (16:57 +0530)
This adds clean up of node's agent instance when node's dynamic
resources are freed.

Change-Id: I588153a99aa27284704b849265b9dcc1ebba3cfa
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
mesh/node.c

index 2d9c4ee..077187e 100644 (file)
@@ -333,6 +333,7 @@ static void free_node_resources(void *data)
        /* Free dynamic resources */
        free_node_dbus_resources(node);
        l_queue_destroy(node->elements, element_free);
+       mesh_agent_remove(node->agent);
        mesh_config_release(node->cfg);
        mesh_net_free(node->net);
        l_free(node->storage_dir);