[fpc-pascal] RTTI Bug or something else i did wrong...

cobines cobines at gmail.com
Fri Jan 15 18:49:49 CET 2010

2010/1/15 Jorge Aldo G. de F. Junior <jagfj80 at gmail.com>:
> ---------------------------------
> C:\Programacao\testcase>rttiobject-testcase.exe
> An unhandled exception occurred at $0040E1E7 :
> EAccessViolation : Access violation
>  $0040E1E7  TRTTIOBJECT__DESTROY,  line 143 of RTTIObject.pas
>  $0040E18A  TRTTIOBJECT__CREATE,  line 139 of RTTIObject.pas
>  $00401515  main,  line 8 of rttiobject-testcase.pas
> ---------------------------------------------------------
> looks like the constructor is calling the destructor before doing
> anything at all...
> what i did wrong ?

Maybe there was an exception raised in the constructor in which case
destructor is called automatically. And in destructor you may be
accessing fTypeData without it being initialized. Try adding:

 if Assigned(fTypeData) and Assigned(fPropList)

in destructor.


More information about the fpc-pascal mailing list