13
0

Fix rt-safety (const reference, not const copy)

PluginInsert (and a few other places) iterate over channel
mappings using a const iterator. However mappings()
allocated memory since it was copied
This commit is contained in:
Robin Gareus 2020-02-05 22:31:22 +01:00
parent 016970df25
commit 01a75c04b1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -106,8 +106,8 @@ public:
typedef std::map<uint32_t, uint32_t> TypeMapping;
typedef std::map<DataType, TypeMapping> Mappings;
Mappings mappings() { return _mappings; }
const Mappings mappings() const { return _mappings; }
Mappings mappings() { return _mappings; }
const Mappings& mappings() const { return _mappings; }
bool operator==(const ChanMapping& other) const {
return (_mappings == other._mappings);