mirror of https://github.com/Icinga/icinga2.git
Fix that custom attribute with function value cannot be cloned
fixes #10583
This commit is contained in:
parent
284a10150b
commit
545607be9f
|
@ -157,18 +157,18 @@ Dictionary::Ptr Dictionary::ShallowClone(void) const
|
|||
/**
|
||||
* Makes a deep clone of a dictionary
|
||||
* and its elements.
|
||||
*
|
||||
*
|
||||
* @returns a copy of the dictionary.
|
||||
*/
|
||||
Object::Ptr Dictionary::Clone(void) const
|
||||
{
|
||||
Dictionary::Ptr dict = new Dictionary();
|
||||
|
||||
|
||||
ObjectLock olock(this);
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, m_Data) {
|
||||
dict->Set(kv.first, kv.second.Clone());
|
||||
}
|
||||
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,3 +39,7 @@ bool Function::IsSideEffectFree(void) const
|
|||
return m_SideEffectFree;
|
||||
}
|
||||
|
||||
Object::Ptr Function::Clone(void) const
|
||||
{
|
||||
return const_cast<Function *>(this);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
|
||||
static Object::Ptr GetPrototype(void);
|
||||
|
||||
virtual Object::Ptr Clone(void) const override;
|
||||
|
||||
private:
|
||||
Callback m_Callback;
|
||||
bool m_SideEffectFree;
|
||||
|
|
Loading…
Reference in New Issue