Browse Source

Fix memory leak in `JSONPointer`

pull/8/head
Anton Tarasenko 3 years ago
parent
commit
3f24194d72
  1. 4
      sources/Text/JSON/JSONPointer.uc

4
sources/Text/JSON/JSONPointer.uc

@ -204,7 +204,9 @@ public final function Text Pop(optional bool doNotRemove)
else { else {
result = components[lastIndex].asText.Copy(); result = components[lastIndex].asText.Copy();
} }
if (!doNotRemove) { if (!doNotRemove)
{
_.memory.Free(components[lastIndex].asText);
components.length = components.length - 1; components.length = components.length - 1;
} }
return result; return result;

Loading…
Cancel
Save