Skip to content

Commit 8934b35

Browse files
JLBuenoLopezEduPonz
authored andcommitted
Structure DynamicType inheritance from TypeObject (#4712)
* Hotfix: Struct DynamicType inheritance from TypeObject Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com> * Apply review suggestion Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com> --------- Signed-off-by: JLBuenoLopez-eProsima <joseluisbueno@eprosima.com>
1 parent 8c2c3d7 commit 8934b35

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,22 +607,24 @@ traits<DynamicTypeBuilder>::ref_type DynamicTypeBuilderFactoryImpl::create_struc
607607
type_descriptor.extensibility_kind(struct_type.struct_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL :
608608
(struct_type.struct_flags() &
609609
xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE));
610-
611-
ret_val = std::make_shared<DynamicTypeBuilderImpl>(type_descriptor);
612-
610+
bool inheritance_correct {true};
613611
if (xtypes::TK_NONE != struct_type.header().base_type()._d())
614612
{
615613
traits<DynamicType>::ref_type base_type = base_type_from_type_identifier(struct_type.header().base_type());
616614
if (base_type)
617615
{
618-
ret_val->get_descriptor().base_type(base_type);
616+
type_descriptor.base_type(base_type);
619617
}
620618
else
621619
{
622620
EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier");
623-
ret_val.reset();
621+
inheritance_correct = false;
624622
}
625623
}
624+
if (inheritance_correct)
625+
{
626+
ret_val = std::make_shared<DynamicTypeBuilderImpl>(type_descriptor);
627+
}
626628

627629
if (ret_val)
628630
{

0 commit comments

Comments
 (0)