diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp index a62bddb3d..1b54c57af 100644 --- a/lib/base/dictionary.cpp +++ b/lib/base/dictionary.cpp @@ -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; } diff --git a/lib/base/function.cpp b/lib/base/function.cpp index 6d0e850a6..d327defde 100644 --- a/lib/base/function.cpp +++ b/lib/base/function.cpp @@ -39,3 +39,7 @@ bool Function::IsSideEffectFree(void) const return m_SideEffectFree; } +Object::Ptr Function::Clone(void) const +{ + return const_cast(this); +} diff --git a/lib/base/function.hpp b/lib/base/function.hpp index 5d912ca89..ff0d8b244 100644 --- a/lib/base/function.hpp +++ b/lib/base/function.hpp @@ -49,6 +49,8 @@ public: static Object::Ptr GetPrototype(void); + virtual Object::Ptr Clone(void) const override; + private: Callback m_Callback; bool m_SideEffectFree;