TJson.JsonToObject throws errors in a multi-thread environment

前端 未结 1 649
借酒劲吻你
借酒劲吻你 2021-02-19 01:16

When using TJson.JsonToObject in a multi-thread environment random access violations occur. I was searching a long time for the problem and I could isolate it with

相关标签:
1条回答
  • 2021-02-19 02:04

    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.

    0 讨论(0)
提交回复
热议问题