bug fix and added app_control launch error handling 77/81577/1
authorkmook <kmook.choi@samsung.com>
Wed, 27 Jul 2016 07:01:16 +0000 (16:01 +0900)
committerkmook <kmook.choi@samsung.com>
Wed, 27 Jul 2016 07:01:16 +0000 (16:01 +0900)
Change-Id: Iad67a3c7ad32db7ced2cfc00b6d704d489227157
Signed-off-by: kmook <kmook.choi@samsung.com>
daemon/service_provider/RemoteAppControlServiceProvider.cpp
lib/conv_lib.cpp

index 6f29d10..5cacc37 100755 (executable)
@@ -218,10 +218,18 @@ static int handle_request(iotcon_representation_h rep, iotcon_request_h request)
                        cb_info.request_handle = request;
                        app_control_cb_map[reply_id] = cb_info;
 
-                       app_control_send_launch_request(app_control, _app_control_cb, (void*)reply_id);
+                       ret = app_control_send_launch_request(app_control, _app_control_cb, (void*)reply_id);
                        _D("app_control_send_launch_request with callback");
 
+                       if (ret != APP_CONTROL_ERROR_NONE) {
+                               _E("Launch request failed(%d)", ret);
+                               iotcon_response_result_e result = IOTCON_RESPONSE_ERROR;
+                               _send_response(request, NULL, result);
+                               app_control_cb_map.erase(reply_id);
+                       }
+
                        bundle_free(appctl_bundle);
+                       app_control_destroy(app_control);
                }
        } else {
                iotcon_response_result_e result;
@@ -272,7 +280,7 @@ void conv::RemoteAppControlServiceProvider::__iotcon_request_cb(iotcon_resource_
 
        if (IOTCON_REQUEST_PUT == type) {
                iotcon_representation_h req_repr;
-               _I("GET request");
+               _I("PUT request");
 
                ret = iotcon_request_get_representation(request, &req_repr);
                if (IOTCON_ERROR_NONE != ret) {
index d5aa0ca..08c4afe 100755 (executable)
@@ -84,7 +84,6 @@ EXTAPI int conv_destroy(conv_h handle)
        ASSERT_NOT_NULL(handle);
 
        _D("conv_destroy..");
-       conv::dbus_client::release();
        std::list<int>::iterator itr_end = handle->request_ids.end();
        callback_map_t::iterator map_iter_end = callback_map.end();
        for (std::list<int>::iterator iter_pos = handle->request_ids.begin(); iter_pos != itr_end; iter_pos++) {