diff options
Diffstat (limited to '4a-hal')
-rw-r--r-- | 4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c index 7baa22c..292bcd8 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c @@ -42,7 +42,7 @@ AFB_ApiT AFB_default; ******************************************************************************/ // Config Section definition -static CtlSectionT ctrlSections[] = +static CtlSectionT ctrlSectionsDefault[] = { { .key = "resources", .loadCB = PluginConfig }, { .key = "halmixer", .loadCB = HalCtlsHalMixerConfig }, @@ -121,6 +121,7 @@ static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle) { int err; CtlConfigT *ctrlConfig; + CtlSectionT *ctrlCurrentSections; if(! cbdata || ! apiHandle) return -1; @@ -136,8 +137,11 @@ static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle) return 1; } + ctrlCurrentSections = malloc(sizeof(ctrlSectionsDefault)); + memcpy(ctrlCurrentSections, ctrlSectionsDefault, sizeof(ctrlSectionsDefault)); + // Load section for corresponding Api - if((err = CtlLoadSections(apiHandle, ctrlConfig, ctrlSections))) + if((err = CtlLoadSections(apiHandle, ctrlConfig, ctrlCurrentSections))) return err; // Declare an event manager for this Api |