Skip to content

Commit 20d3974

Browse files
committed
Refs #21672. Refactor to create builtin objects inside factory constructor.
Signed-off-by: Miguel Company <[email protected]>
1 parent 25c64e8 commit 20d3974

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/fastrtps/types/TypeObjectFactory.h

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class TypeObjectFactory
6060
void nullify_all_entries(
6161
const TypeIdentifier* identifier);
6262

63+
void create_basic_identifiers();
64+
6365
void create_builtin_annotations();
6466

6567
void apply_type_annotations(

src/cpp/dynamic-types/TypeObjectFactory.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ TypeObjectFactory* TypeObjectFactory::get_instance()
7373
}
7474

7575
auto instance = new TypeObjectFactory();
76-
instance->create_builtin_annotations();
7776
g_instance = instance;
7877
g_instance_state.store(TypeObjectFactoryInstanceState::CREATED);
7978

@@ -94,6 +93,12 @@ ReturnCode_t TypeObjectFactory::delete_instance()
9493
}
9594

9695
TypeObjectFactory::TypeObjectFactory()
96+
{
97+
create_basic_identifiers();
98+
create_builtin_annotations();
99+
}
100+
101+
void TypeObjectFactory::create_basic_identifiers()
97102
{
98103
std::unique_lock<std::recursive_mutex> scoped(m_MutexIdentifiers);
99104
// Generate basic TypeIdentifiers

0 commit comments

Comments
 (0)