From 9e1d6acfa7bfd2de35acc5bde831f39d06fe8c88 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 26 Dec 2023 13:36:20 -0800 Subject: [PATCH] Fix StructPublisher move constructor --- .../src/main/native/include/networktables/StructArrayTopic.h | 3 ++- ntcore/src/main/native/include/networktables/StructTopic.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ntcore/src/main/native/include/networktables/StructArrayTopic.h b/ntcore/src/main/native/include/networktables/StructArrayTopic.h index f0b557ef642..667570bd7e9 100644 --- a/ntcore/src/main/native/include/networktables/StructArrayTopic.h +++ b/ntcore/src/main/native/include/networktables/StructArrayTopic.h @@ -264,7 +264,8 @@ class StructArrayPublisher : public Publisher { StructArrayPublisher(StructArrayPublisher&& rhs) : Publisher{std::move(rhs)}, m_buf{std::move(rhs.m_buf)}, - m_schemaPublished{rhs.m_schemaPublished}, + m_schemaPublished{ + rhs.m_schemaPublished.load(std::memory_order_relaxed)}, m_info{std::move(rhs.m_info)} {} StructArrayPublisher& operator=(StructArrayPublisher&& rhs) { diff --git a/ntcore/src/main/native/include/networktables/StructTopic.h b/ntcore/src/main/native/include/networktables/StructTopic.h index 7bbacb3509a..b69d0af62bc 100644 --- a/ntcore/src/main/native/include/networktables/StructTopic.h +++ b/ntcore/src/main/native/include/networktables/StructTopic.h @@ -205,7 +205,8 @@ class StructPublisher : public Publisher { StructPublisher(StructPublisher&& rhs) : Publisher{std::move(rhs)}, - m_schemaPublished{rhs.m_schemaPublished}, + m_schemaPublished{ + rhs.m_schemaPublished.load(std::memory_order_relaxed)}, m_info{std::move(rhs.m_info)} {} StructPublisher& operator=(StructPublisher&& rhs) {