Delphi RTTI Context limitation: not thread safe for method RTTI
Posted by jpluimers on 2019/07/16
In a comment to [WayBack] Update: It was not clear what I was asking so I updated the question. I am trying to call RTTI Invoke from within TTask.Run and I get an AV. I have t… – John Kouraklis – Google+
… you can’t use a TRTTIMethod instance from a TRTTIContext of another thread….+Eric Berger+Panagiotis Drivilas That’s it. Many Thanks
–jeroen
Stefan Glienke said
The issue in fact is that the TRttiMethod instance might have been destroyed because the TRttiContext went out of scope and destroyed any TRtti* instances that it owns. This can also happen in single threaded code. If you ensure that the instance stays alive then it works.