}
return "";
},
+ [&]()->std::string {
+ if (GetReturnTypeString(i->GetType()) != "void ")
+ return " ret";
+ return "";
+ },
[&]()->std::string {
return i->GetID();
},
[&]()->std::string {
return GetMethodWriteString(inf, *i);
},
+ [&]()->std::string {
+ if (GetReturnTypeString(i->GetType()) != "void ")
+ return " ret";
+ return "";
+ },
[&]()->std::string {
return GetMethodReadString(inf, *i);
}));
R"__c_cb(
$$rpc_port_proxy_##_invoke_$$(rpc_port_proxy_##_h h$$)
{
- rpc_port_parcel_h parcel;
+ rpc_port_parcel_h parcel = NULL;
int r;
$$
$$
g_rec_mutex_lock(&h->mutex);
rpc_port_parcel_create(&parcel);
+ if (parcel == NULL) {
+ _E("Out of memory");
+ set_last_result(RPC_PORT_ERROR_OUT_OF_MEMORY);
+ g_rec_mutex_unlock(&h->mutex);
+ return$$;
+ }
rpc_port_parcel_write_int32(parcel, ##_METHOD_$$);
$$
r = rpc_port_parcel_send(parcel, h->port);
+ rpc_port_parcel_destroy(parcel);
if (r != RPC_PORT_ERROR_NONE) {
_E("Failed to send parcel. result(%d)", r);
- r = RPC_PORT_ERROR_IO_ERROR;
+ set_last_result(RPC_PORT_ERROR_IO_ERROR);
+ g_rec_mutex_unlock(&h->mutex);
+ return$$;
}
-
- rpc_port_parcel_destroy(parcel);
$$
}
)__c_cb";