We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6cb095 commit 43cc32eCopy full SHA for 43cc32e
rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp
@@ -641,7 +641,13 @@ inline void deserialize_field<std::string>(
641
}
642
deser >> *static_cast<std::string *>(field);
643
} else if (member->array_size_ && !member->is_upper_bound_) {
644
- deser.deserializeArray(static_cast<std::string *>(field), member->array_size_);
+ std::string * array = static_cast<std::string *>(field);
645
+ if (call_new) {
646
+ for (size_t i = 0; i < member->array_size_; ++i) {
647
+ new(&array[i]) std::string();
648
+ }
649
650
+ deser.deserializeArray(array, member->array_size_);
651
} else {
652
auto & vector = *reinterpret_cast<std::vector<std::string> *>(field);
653
if (call_new) {
0 commit comments