diff --git a/source/backend/plugin/CarlaPluginCLAP.cpp b/source/backend/plugin/CarlaPluginCLAP.cpp index 0c52c1f9d..d13fd61d3 100644 --- a/source/backend/plugin/CarlaPluginCLAP.cpp +++ b/source/backend/plugin/CarlaPluginCLAP.cpp @@ -1473,7 +1473,7 @@ public: fOutputAudioBuffers.extra[i].offset = aOuts; fOutputAudioBuffers.extra[i].isMain = portInfo.flags & CLAP_AUDIO_PORT_IS_MAIN; for (uint32_t j=0; j&> (data).exchange (newValue.data)); - } - /** These values are the byte-order mark (BOM) values for a UTF-8 stream. */ enum { @@ -566,6 +562,8 @@ public: private: CharType* data; + + friend class String; }; } diff --git a/source/modules/water/text/String.cpp b/source/modules/water/text/String.cpp index c94ad6d05..7dd4cf11e 100644 --- a/source/modules/water/text/String.cpp +++ b/source/modules/water/text/String.cpp @@ -242,7 +242,8 @@ void String::clear() noexcept String& String::operator= (const String& other) noexcept { StringHolder::retain (other.text); - StringHolder::release (text.atomicSwap (other.text)); + std::swap(text.data, const_cast(other.text).data); + StringHolder::release (other.text); return *this; }