Utils: Fix memory leak in JsonMemoryPool

objects are freed, but their dtors are not called...

Detected by valgrind

Change-Id: Iec8d78c205e9b2722ee5a89941df96c3383b385b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2014-11-21 11:35:51 +02:00
committed by Orgad Shaneh
parent 1679c07e74
commit 8f68b7ccba

View File

@@ -42,8 +42,10 @@ using namespace Utils;
JsonMemoryPool::~JsonMemoryPool()
{
foreach (char *obj, _objs)
foreach (char *obj, _objs) {
reinterpret_cast<JsonValue *>(obj)->~JsonValue();
delete[] obj;
}
}
JsonValue::JsonValue(Kind kind)