X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so-v3.c;h=230a93fc2281fed85c89e0d7788ec8e7b7f92313;hb=16f014ef35b8355de1006891fe6920c8b51675fe;hp=373386ef17ba8dad607f4e374c6a58a0a7096a82;hpb=de0527f7cf5b4a4278698ab034a332cf75723300;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so-v3.c b/src/afb-api-so-v3.c index 373386ef..230a93fc 100644 --- a/src/afb-api-so-v3.c +++ b/src/afb-api-so-v3.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 "IoT.bzh" + * Copyright (C) 2018, 2019 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,6 +15,8 @@ * limitations under the License. */ +#if WITH_DYNAMIC_BINDING + #define _GNU_SOURCE #include @@ -117,7 +119,14 @@ int afb_api_so_v3_add(const char *path, void *handle, struct afb_apiset *declare export = afb_export_create_none_for_path(declare_set, call_set, path, init, &a); if (export) { - afb_export_unref(export); + /* + * No call is done to afb_export_unref(export) because: + * - legacy applications may use the root API emitting messages + * - it allows writting applications like bindings without API + * But this has the sad effect to introduce a kind of leak. + * To avoid this, if necessary further developement should list bindings + * and their data. + */ return 1; } } @@ -128,3 +137,4 @@ error: return -1; } +#endif