summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Oleynik <aoleynik@luxoft.com>2015-08-31 18:19:17 +0300
committerAndrey Oleynik <aoleynik@luxoft.com>2015-09-02 14:38:45 +0300
commit9f001ad95180a5157b8913567102a5808eb2e317 (patch)
tree271380a0aad5df6ee35943b632704ff86b1d550b
parent12d569a8ae8f8822c3bba13c82f3667780d94250 (diff)
downloadsmartdevicelink-9f001ad95180a5157b8913567102a5808eb2e317.tar.gz
Fixes crash while trying to get app connection key
Seems, like request is being deleted by request controller right after sending of response, which causes members corruptions and crash. Fixes: APPLINK-15840, APPLINK-15838 Conflicts: src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
index 784fa1cbf..1c0948d07 100644
--- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
+++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
@@ -333,14 +333,14 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
if (!IsPendingResponseExist()) {
bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
- || ((hmi_apis::Common_Result::SUCCESS == ui_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
- && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
- || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
- && (hmi_apis::Common_Result::SUCCESS == tts_result_));
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
+ || ((hmi_apis::Common_Result::SUCCESS == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
+ || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_));
mobile_apis::Result::eType result_code;
const char* return_info = NULL;
@@ -352,19 +352,20 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
std::string("Unsupported phoneme type sent in a prompt").c_str();
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
} else {
result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
+ std::max(ui_result_, tts_result_));
}
+ // TODO(AOleynik): APPLINK-15858
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
SendResponse(result, result_code, return_info,
&(message[strings::msg_params]));
- ApplicationSharedPtr application =
- ApplicationManagerImpl::instance()->application(connection_key());
if (!application) {
LOG4CXX_DEBUG(logger_, "NULL pointer.");
return;