return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
- const char* context_data_raw = "";
+ std::string context_data_raw = "";
bool emit_ret = false;
std::string provider_appid = DBManager::GetProviderAppId(
impl_->cur_provider_id_.c_str());
if (impl_->context_data_ != nullptr) {
try {
- context_data_raw = reinterpret_cast<const char*>(
- impl_->context_data_->ToRaw().first.get());
+ context_data_raw = std::string(reinterpret_cast<const char*>(
+ impl_->context_data_->ToRaw().first.get()));
} catch (const std::bad_alloc &ba) {
LOGE("Exception bad_alloc");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
util::GetAppId().c_str(),
impl_->complication_id_,
impl_->cur_type_,
- context_data_raw));
+ context_data_raw.c_str()));
if (!emit_ret)
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;