TJson.JsonToObject<T> throws errors in a multi-thread environment TJson.JsonToObject<T> throws errors in a multi-thread environment multithreading multithreading

TJson.JsonToObject<T> throws errors in a multi-thread environment


The method TJSONUnMarshal.ObjectInstance in REST.JsonReflect.pas has a severe bug:

It calls FreeAndNil on a TRttiType instance. This should never be done because all TRtti*** instances are managed by the TRttiContext.

After I removed the FreeAndNil call I could not reproduce the access violation anymore.

Reported as: https://quality.embarcadero.com/browse/RSP-10035

P.S. I also think that https://quality.embarcadero.com/browse/RSP-9815 will affect your code.