aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/4a-internals-hal/4a-internals-hal-api-loader.c15
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,