Fix Value::copyPayload() and Value::copy() (#704)
Value copy constructor shares the same code with Value::copy() and Value::copyPayload().
New Value::releasePayload() is used to free payload memory.
Fixes: #704
diff --git a/include/json/value.h b/include/json/value.h
index d1bf8ff..1643210 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -606,6 +606,7 @@
private:
void initBasic(ValueType type, bool allocated = false);
+ void releasePayload();
Value& resolveReference(const char* key);
Value& resolveReference(const char* key, const char* end);