Change-Id: If225a38efbd1809a623d2cf54b125a6ba94fd095
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
/* install the widget */
ifo = install_widget(wgtfile, root, force);
/* install the widget */
ifo = install_widget(wgtfile, root, force);
jbus_reply_error_s(jreq, "\"installation failed\"");
jbus_reply_error_s(jreq, "\"installation failed\"");
- return;
- }
-
- /* build the response */
- resp = json_object_new_object();
- if(!resp || !j_add_string(resp, "added", wgt_info_desc(ifo)->idaver)) {
- json_object_put(resp);
+ else {
+ /* build the response */
+ resp = json_object_new_object();
+ if(!resp || !j_add_string(resp, "added", wgt_info_desc(ifo)->idaver))
+ jbus_reply_error_s(jreq, "\"out of memory but installed!\"");
+ else
+ jbus_reply_j(jreq, resp);
+
+ /* clean-up */
- jbus_reply_error_s(jreq, "\"out of memory but installed!\"");
- return;
- /* reply and propagate event */
- jbus_reply_j(jreq, resp);
- jbus_send_signal_j(jbus, "changed", resp);
- json_object_put(resp);
+ /* still sends the signal */
+ jbus_send_signal_s(jbus, "changed", "true");
}
static void on_uninstall(struct jreq *jreq, struct json_object *req)
}
static void on_uninstall(struct jreq *jreq, struct json_object *req)
/* install the widget */
rc = uninstall_widget(idaver, root);
/* install the widget */
rc = uninstall_widget(idaver, root);
jbus_reply_error_s(jreq, "\"uninstallation had error\"");
jbus_reply_error_s(jreq, "\"uninstallation had error\"");
- return;
- }
- jbus_reply_s(jreq, "true");
+ else
+ jbus_reply_s(jreq, "true");
+
+ /* still sends the signal */
+ jbus_send_signal_s(jbus, "changed", "true");