aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/radio
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-06 13:56:00 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-06 13:56:00 +0100
commita10fa6960df758dcfcb406dcee6383be5d494187 (patch)
tree676f64010ba300119031fae2c355cf142fec4218 /plugins/radio
parent12686e3f00eb942bf587e99f80654400cc6995b6 (diff)
Fix Audio/Radio reinitialization issue
Audio and Radio plugins init() functions were re-creating a new client context each time, but it is actually unwanted as afb-radio <TokenRefresh> widgets uses this function to initialize AND refresh the context. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'plugins/radio')
-rw-r--r--plugins/radio/radio-api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/radio/radio-api.c b/plugins/radio/radio-api.c
index b09cea86..d6855fea 100644
--- a/plugins/radio/radio-api.c
+++ b/plugins/radio/radio-api.c
@@ -131,7 +131,8 @@ STATIC json_object* init (AFB_request *request) { /* AFB_SESSION_CHECK */
json_object *jresp;
/* create a private client context */
- request->context = initRadioCtx();
+ if (!request->context)
+ request->context = initRadioCtx();
jresp = json_object_new_object();
json_object_object_add(jresp, "info", json_object_new_string ("Radio initialized"));