File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1455,6 +1455,16 @@ ReturnCode_t DomainParticipantImpl::register_type(
14551455 return RETCODE_BAD_PARAMETER ;
14561456 }
14571457
1458+ /*
1459+ * The type object registration sets the TypeIdentifiers in the type support's underlying TopicDataType.
1460+ * This means that that we need need to trigger the registration of the type object representation
1461+ * (idempotent operation) before finding the type in the registry.
1462+ * Otherwise, registering two TypeSupport instances with the same underlying TopicDataType will fail upon
1463+ * the second registration, as the TypeIdentifiers of the retrieved type from the registry would not be equal
1464+ * to those of the incoming type support.
1465+ */
1466+ type.get ()->register_type_object_representation ();
1467+
14581468 TypeSupport t = find_type (type_name);
14591469
14601470 if (!t.empty ())
@@ -1472,8 +1482,6 @@ ReturnCode_t DomainParticipantImpl::register_type(
14721482 std::lock_guard<std::mutex> lock (mtx_types_);
14731483 types_.insert (std::make_pair (type_name, type));
14741484
1475- type.get ()->register_type_object_representation ();
1476-
14771485 return RETCODE_OK ;
14781486}
14791487
You can’t perform that action at this time.
0 commit comments