From a10fa6960df758dcfcb406dcee6383be5d494187 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Wed, 6 Jan 2016 13:56:00 +0100 Subject: 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 widgets uses this function to initialize AND refresh the context. Signed-off-by: Manuel Bachmann --- plugins/radio/radio-api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/radio') 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")); -- cgit 1.2.3-korg