diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-10-11 15:25:42 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-10-17 11:29:21 +0200 |
commit | f540130618e106d79b5eef0ef548d761a4585632 (patch) | |
tree | 24b6615afc8a5b6b88b27279614a5d60a0fa0aed | |
parent | f3d1f0a9f78f0e4a633cfafca649fd3289f981ae (diff) |
Unmanage all halmap before deleting hal api
Unmanage all halmap before deleting hal api.
This assures removing all added custom ALSA control
before deleting hal api.
BUG-AGL: SPEC-2893
Change-Id: Id7af6c198d3d215709e81679e4e310d24b501458
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-api-loader.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-api-loader.c b/src/4a-internals-hal/4a-internals-hal-api-loader.c index c833521..a8b62c6 100644 --- a/src/4a-internals-hal/4a-internals-hal-api-loader.c +++ b/src/4a-internals-hal/4a-internals-hal-api-loader.c @@ -210,10 +210,21 @@ int InternalHalDeleteApi(afb_api_t apiHandle, struct cds_list_head *halDataListH return -1; } + err = InternalHalUnmanageAllHalMap(toDeleteHalData->internalHalData->apiHandle, + &toDeleteHalData->internalHalData->halMapListHead, + &toDeleteHalData->internalHalData->probedDevicesListHead); + if(err) { + AFB_API_ERROR(apiHandle, + "Error %i happened while trying to unmanage all halmap of '%s' hal api", + err, + toDeleteHalData->apiName); + return -2; + } + toDeleteApiName = strdup(toDeleteHalData->apiName); if(! toDeleteApiName) { AFB_API_ERROR(apiHandle, "Didn't succeed to store (allocate) 'apiName' string"); - return -2; + return -3; } err = HalUtlRemoveHalDataAndDeleteHalApi(toDeleteHalData->internalHalData->apiHandle, @@ -225,7 +236,7 @@ int InternalHalDeleteApi(afb_api_t apiHandle, struct cds_list_head *halDataListH err, toDeleteApiName); free(toDeleteApiName); - return -3; + return -4; } AFB_API_NOTICE(apiHandle, |