From a51d044c82d2e39a2d9a79dd2ce181ef7bd32b02 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 21 Jan 2022 15:53:04 +0000 Subject: Fix various edge cases in extensible synchronisation. - Fix not forwarding the accountid extensible if it is set. - Rename the variadic Set() overload to SetFwd(). - Re-add the `const T&` overload of Set(). - Move `bool synced` to SimpleExtItem from StringExtItem. - Only sync extensibles if their instance is marked as syncable. --- src/extensible.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/extensible.cpp') diff --git a/src/extensible.cpp b/src/extensible.cpp index 641d62337..1e02fc526 100644 --- a/src/extensible.cpp +++ b/src/extensible.cpp @@ -232,14 +232,14 @@ bool BoolExtItem::Get(const Extensible* container) const void BoolExtItem::Set(Extensible* container, bool sync) { SetRaw(container, reinterpret_cast(1)); - if (sync) + if (sync && synced) Sync(container, reinterpret_cast(1)); } void BoolExtItem::Unset(Extensible* container, bool sync) { UnsetRaw(container); - if (sync) + if (sync && synced) Sync(container, reinterpret_cast(0)); } @@ -299,8 +299,7 @@ void IntExtItem::Unset(Extensible* container, bool sync) } StringExtItem::StringExtItem(Module* owner, const std::string& key, ExtensionType exttype, bool sync) - : SimpleExtItem(owner, key, exttype) - , synced(sync) + : SimpleExtItem(owner, key, exttype, sync) { } -- cgit v1.3.1-10-gc9f91