delete resources in d'tor to make Valgrind happy. :-)

JSON-155
Roker 3 years ago
parent 2c23d1b474
commit b9183a12ea

@ -23,6 +23,17 @@ FunctionMap::FunctionMap(std::initializer_list<FunctionMap::value_type> il)
}
}
FunctionMap::~FunctionMap()
{
for(auto& elem : v)
{
delete elem.second;
elem.second = nullptr;
}
}
template<>
js::Value Type2String<std::string>::get() { return "String"; }

@ -147,16 +147,13 @@ public:
typedef typename Return<R>::return_type ReturnType;
virtual ~Func() = default;
virtual bool isSeparator() const noexcept override
{
return false;
}
virtual bool isSeparator() const noexcept override { return false; }
Func() : fn() {}
Func( const std::function<ReturnType(typename Args::c_type ...)>& _f )
: fn(_f)
{}
Func(const Func<R, Args...>&) = delete;
std::function<ReturnType(typename Args::c_type ...)> fn;
@ -237,6 +234,7 @@ public:
const_iterator find(const std::string&) const noexcept;
FunctionMap(std::initializer_list<value_type> il);
~FunctionMap();
private:
FunctionMapBase v;

Loading…
Cancel
Save