libafbwsc releases json_object on behalf of application.
Then calling json_object in this library may cause
double free, so fix it.
Bug-AGL: SPEC-1471
Change-Id: I1bb3109c80891718f7bfd69e67688c1c880e95de
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
/* Initialize interface from websocket */
minterface.on_hangup = _on_hangup_static;
/* Initialize interface from websocket */
minterface.on_hangup = _on_hangup_static;
- minterface.on_call = _on_call_static; /* Is this necessary? */
+ minterface.on_call = _on_call_static;
minterface.on_event = _on_event_static;
muri += "ws://localhost:" + to_string(mport) + "/api?token=" + mtoken; /*To be modified*/
sp_websock = afb_ws_client_connect_wsj1(mploop, muri.c_str(), &minterface, this);
minterface.on_event = _on_event_static;
muri += "ws://localhost:" + to_string(mport) + "/api?token=" + mtoken; /*To be modified*/
sp_websock = afb_ws_client_connect_wsj1(mploop, muri.c_str(), &minterface, this);
*
* #### Return
* Nothing
*
* #### Return
* Nothing
+ *
+ * #### Note
+ * Don't release json_object by json_object_put in handler_func.
+ * The resource is released by libafbwsc library.
*/
void LibHomeScreen::set_event_handler(enum EventType et, handler_func f)
{
*/
void LibHomeScreen::set_event_handler(enum EventType et, handler_func f)
{
i->second(json_data);
}
}
i->second(json_data);
}
}
-
- json_object_put(ev_contents);
{
struct json_object* reply = afb_wsj1_msg_object_j(msg);
onReply(reply);
{
struct json_object* reply = afb_wsj1_msg_object_j(msg);
onReply(reply);
-
- json_object_put(reply);