Merge pull request #114 from baylesj/fix-memory-leak

Fix memory leak in concrete constraints
This commit is contained in:
Tristan Penman 2020-12-03 10:44:56 +11:00 committed by GitHub
commit cf64893031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,16 +189,16 @@ public:
adapters::FrozenValue * getValue() const adapters::FrozenValue * getValue() const
{ {
return m_value; return m_value.get();
} }
void setValue(const adapters::Adapter &value) void setValue(const adapters::Adapter &value)
{ {
m_value = value.freeze(); m_value = std::unique_ptr<adapters::FrozenValue>(value.freeze());
} }
private: private:
adapters::FrozenValue *m_value; std::unique_ptr<adapters::FrozenValue> m_value;
}; };
/** /**