commit 0d3f16ec5ece7b268a228c2faaa155976fcc214c
parent c9d8346d40c53992062cfc98d775861b32258a8f
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Thu, 29 Nov 2018 19:56:00 +0100
scan: Call .destroy in scan_request_free
The main difference with this is that scan_context removal will also
trigger the .destroy calls. Normally there won't be any requests left
during scan_context but if there were any we should call destroy on
them.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/scan.c b/src/scan.c
@@ -119,6 +119,9 @@ static void scan_request_free(void *data)
{
struct scan_request *sr = data;
+ if (sr->destroy)
+ sr->destroy(sr->userdata);
+
l_queue_destroy(sr->cmds, (l_queue_destroy_func_t) l_genl_msg_unref);
l_free(sr);
@@ -129,9 +132,6 @@ static void scan_request_trigger_failed(struct scan_request *sr, int err)
if (sr->trigger)
sr->trigger(err, sr->userdata);
- if (sr->destroy)
- sr->destroy(sr->userdata);
-
scan_request_free(sr);
}