Skip to content

Commit

Permalink
Fixing failing tests on rmw_fastrtps_dynamic_cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany committed Nov 27, 2018
1 parent f6cb095 commit 43cc32e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,13 @@ inline void deserialize_field<std::string>(
}
deser >> *static_cast<std::string *>(field);
} else if (member->array_size_ && !member->is_upper_bound_) {
deser.deserializeArray(static_cast<std::string *>(field), member->array_size_);
std::string * array = static_cast<std::string *>(field);
if (call_new) {
for (size_t i = 0; i < member->array_size_; ++i) {
new(&array[i]) std::string();
}
}
deser.deserializeArray(array, member->array_size_);
} else {
auto & vector = *reinterpret_cast<std::vector<std::string> *>(field);
if (call_new) {
Expand Down

0 comments on commit 43cc32e

Please sign in to comment.