diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2018-06-14 15:07:35 +0200 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2018-06-14 15:07:35 +0200 |
commit | f1f15455d62e56135cd5e0131d415bbbc2a78fb6 (patch) | |
tree | 77ea666db14bff55e5df97f1eaa3856ec788860d /ahl-binding/ahl-binding.cpp | |
parent | 6cc7b3b79beab5d1f0a6a1cd23d565803b3c9b52 (diff) |
Controller call the config twice due to multiple initialisation phase,
the code should handle this behaviour to not doing things twice.
Also removed an unused section from the config file.
Change-Id: Iecf09fe494173b757c3557d838782c50153dbfb4
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'ahl-binding/ahl-binding.cpp')
-rw-r--r-- | ahl-binding/ahl-binding.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ahl-binding/ahl-binding.cpp b/ahl-binding/ahl-binding.cpp index 2bf1664..37e6847 100644 --- a/ahl-binding/ahl-binding.cpp +++ b/ahl-binding/ahl-binding.cpp @@ -330,6 +330,8 @@ int ahl_binding_t::parse_roles_config(json_object* o) { assert(o != nullptr); assert(json_object_is_type(o, json_type_array)); + + if (roles_.size()) return 0; // Roles already added, ignore. size_t count = json_object_array_length(o); roles_.reserve(count); |