diff --git a/include/chaiscript/chaiscript_threading.hpp b/include/chaiscript/chaiscript_threading.hpp index 4568116..15b4a64 100644 --- a/include/chaiscript/chaiscript_threading.hpp +++ b/include/chaiscript/chaiscript_threading.hpp @@ -158,7 +158,7 @@ namespace chaiscript if (itr != m_instances.end()) { return itr->second; } - std::shared_ptr new_instance(new T()); + std::shared_ptr new_instance(std::make_shared()); m_instances.insert(std::make_pair(std::this_thread::get_id(), new_instance)); diff --git a/include/chaiscript/dispatchkit/proxy_constructors.hpp b/include/chaiscript/dispatchkit/proxy_constructors.hpp index f354ae5..2866d97 100644 --- a/include/chaiscript/dispatchkit/proxy_constructors.hpp +++ b/include/chaiscript/dispatchkit/proxy_constructors.hpp @@ -30,7 +30,7 @@ namespace chaiscript Proxy_Function build_constructor_(Class (*)(Params...)) { typedef std::shared_ptr (sig)(Params...); - return Proxy_Function(new Proxy_Function_Impl(std::function(&(constructor_)))); + return Proxy_Function(static_cast(new Proxy_Function_Impl(std::function(&(constructor_))))); } } } diff --git a/include/chaiscript/dispatchkit/register_function.hpp b/include/chaiscript/dispatchkit/register_function.hpp index 1ed8ebf..f476a25 100644 --- a/include/chaiscript/dispatchkit/register_function.hpp +++ b/include/chaiscript/dispatchkit/register_function.hpp @@ -61,7 +61,7 @@ namespace chaiscript { /// \todo is it possible to reduce the number of templates generated here? return Proxy_Function( - new Proxy_Function_Impl::Signature>(to_function(t))); + static_cast(new Proxy_Function_Impl::Signature>(to_function(t)))); } }; @@ -118,7 +118,7 @@ namespace chaiscript template Proxy_Function fun(const std::function &f) { - return Proxy_Function(new dispatch::Proxy_Function_Impl(f)); + return Proxy_Function(static_cast(new dispatch::Proxy_Function_Impl(f))); }