Skip to content

Commit 6170e28

Browse files
committed
Fix build error in UE5
error message: In file included from /home/xxxx/UnrealProjects/ROSDemo/Plugins/ROSIntegration/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Development/ROSIntegration/Module.ROSIntegration.cpp:48: /home/xxxx/UnrealProjects/ROSDemo/Plugins/ROSIntegration/Source/ROSIntegration/Private/rosbridge2cpp/ros_bridge.cpp:31:18: error: passing 4-byte aligned argument to 128-byte aligned parameter 1 of 'bson_destroy' may result in an unaligned pointer access [-Werror,-Walign-mismatch] bson_destroy(queue.front()); ^ /home/xxxx/UnrealProjects/ROSDemo/Plugins/ROSIntegration/Source/ROSIntegration/Private/rosbridge2cpp/ros_bridge.cpp:136:18: error: passing 4-byte aligned argument to 128-byte aligned parameter 1 of 'bson_destroy' may result in an unaligned pointer access [-Werror,-Walign-mismatch] bson_destroy(queue.front());
1 parent d0018d5 commit 6170e28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/ROSIntegration/Private/rosbridge2cpp/ros_bridge.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ namespace rosbridge2cpp {
2828
{
2929
while (queue.size())
3030
{
31-
bson_destroy(queue.front());
31+
bson_t* bson = queue.front();
3232
queue.pop();
33+
bson_destroy(bson);
3334
}
3435
}
3536
}
@@ -133,8 +134,9 @@ namespace rosbridge2cpp {
133134
auto& queue = publisher_queues_[publisher_topics_[topic_name]];
134135
if (queue_size > 0 && queue.size() >= queue_size) // make space if necessary
135136
{
136-
bson_destroy(queue.front());
137+
bson_t* bson = queue.front();
137138
queue.pop();
139+
bson_destroy(bson);
138140
}
139141

140142
queue.push(message);

0 commit comments

Comments
 (0)