Hi, I am getting a leak. Should this work out of the box?
Thanks in advance.
namespace CommonFunctionLambdas
{
template<typename Type>
inline std::function<ReferenceCountedObjectPtr<Type> (ValueTree)> newReferenceCountedObject
= []( ValueTree valueTree)
{
ReferenceCountedObjectPtr<Type> returnObject = new Type (valueTree);
valueTree.setProperty (
"attached"
, dynamic_cast<Type*> ( returnObject.get() )
, nullptr
);
return returnObject;
};
}