Hi Delphi experts.
I do not know how to find the person who wrote this for me originally. He was a subcontractor to a firm in Russia.
The problems are limited. They show up only when going deep into arrays within the json. “Obviously” the code is doing something wrong in terms of how and when it is releasing memory.
I am wondering whether anyone here would be willing and able to help me solve this. The unit is not currently in open source but it could be.
This approach to parsing JSON is not meant to be the fastest. It definitely is not. It is meant to be the most easy to read, and having just converted a project that was blowing up due to these bugs from this Variant approach over to the core Delphi JSON Iterator approach, I will say, I really think it is much easier to read. However that is obviously useless with bad memory management.
Before you volunteer, I should say that I tried chasing these bugs for a couple of days and it led to the Delphi IDE crashing. A lot. I had to reboot windows sometimes. Memory is being trampled and until that stops, development needs to be in a nice safe sandbox.
I have a DUnitX test unit which currently passes all tests, even in Delphi 11, because it does not yet include an example that drills down into tested arrays the way that my project sample did. I will be sort that part out. Obviously there needs to be a straightforward reproducible issue.
Well… if I have not already scared you away and you know Variants, I would very much like to hear from you. Happy to send you a copy of the unit, probably not attached here but rather by email.