Made destructors virtual

This commit is contained in:
Mikhail Lobotskiy
2023-11-10 21:02:35 +04:00
parent a4ac108c7c
commit 6bafc84285
2 changed files with 18 additions and 1 deletions

View File

@ -6,6 +6,10 @@ namespace NSJSON
{
}
IBaseValue::~IBaseValue()
{
}
void IBaseValue::setNull()
{
m_type = vtNull;
@ -155,6 +159,14 @@ namespace NSJSON
}
}
CObject::CObject()
{
}
CObject::~CObject()
{
}
void CObject::addMember(const IBaseValue* pValue, const std::string& name)
{
if (m_type != vtObject)

View File

@ -25,6 +25,7 @@ namespace NSJSON
public:
IBaseValue();
virtual ~IBaseValue();
protected:
ValueType m_type;
@ -45,7 +46,7 @@ namespace NSJSON
CValue(CValue&& other) = delete;
// TODO: move constructor and assignment operator ???
// TODO: constructors from value ???
~CValue();
virtual ~CValue();
CValue& operator=(const CValue& other);
CValue& operator=(CValue&& other) = delete;
@ -79,6 +80,10 @@ namespace NSJSON
// extend this class to make custom objects serializable to JS
class JS_DECL CObject : public IBaseValue
{
public:
CObject();
virtual ~CObject();
public:
// Add member to JS object when it will be serialized
void addMember(const IBaseValue* pValue, const std::string& name);