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

Jorge Aldo G. de F. Junior jagfj80 at gmail.com
Sat Jan 16 04:56:20 CET 2010


the error happens even if i remove all statements in the constructor...

Constructor TRTTIObject.Create(Const aInstanceName: String);
Begin
    Inherited Create;
End;

Still gives errors... (why should a constructor call the destructor anyway ?)

2010/1/15 cobines <cobines at gmail.com>:
> 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.
>
> --
> cobines
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list