SIGSEGV, when using extended Rtti
## Summary SIGSEGV, when using extended Rtti ## System Information <!-- The more information are provided the easier it is to replicate the bug --> - **Operating system:** Linux - **Processor architecture:** x86-64 (9e8f09b93f3844cc6f8f5ad9926b6eebcfc06342) - **Compiler version:** trunk - **Device:** Computer ## Steps to reproduce ```pascal program Project1; {$mode DELPHI} uses SysUtils, Rtti; type TCurrencyHandler = procedure (Sender: TObject; Cur: Currency) of object; procedure DoTest; var Context: TRttiContext; Ty: TRttiType; P: TRttiParameter; begin Context := TRttiContext.Create(); try Ty := Context.GetType(TypeInfo(TCurrencyHandler)); for P in (Ty as TRttiMethodType).GetParameters() do WriteLn(P.Name, ': ', P.ParamType.Name); finally Context.Free; end; end; begin DoTest; end. ``` ## Possible fixes The reason is that in some cases you forget to pass FUsePublishedOnly to "child" TRttiObject and TRttiContext objects. As a result, the objects end up in different pools and some of them are destroyed. In the example above:\ Ty.FUsePublishedOnly = True\ P.FUsePublishedOnly = False, but it is placed in GRttiPool[True]\ P.ParamType is placed in GRttiPool[True] and is destroyed on exit from TRttiMethodTypeParameter.GetParamType
issue