madorin / fibplus

FibPlus Library for Delphi and C++Builder. Data access components for Firebird & Interbase.
168 stars 58 forks source link

TFIBxxxfield.OnValidate might dump #30

Closed riniman closed 11 months ago

riniman commented 6 years ago

TpFIBDataSet.TFIBxxxField.OnValidate will create an Access Violation error when reading the same field as the OnValidate "sits" on.

OnValidate on a TStringField in a TpFIBDataSet works.

Delphi Tokyo (10.2.3)

TestOnValidate.zip

fduron commented 4 years ago

TpFIBDataSet.TFIBxxxField.OnValidate will create an Access Violation error when reading the same field as the OnValidate "sits" on.

OnValidate on a TStringField in a TpFIBDataSet works.

Delphi Tokyo (10.2.3)

TestOnValidate.zip

This issue remains on Delphi Rio (10.3.3)

OLMIG62 commented 1 year ago

Tested with Delphi Sydney 10.4, work fine!

procedure TFIBCustomDataSet.DoFieldValidate(Field:TField;Buffer:Pointer); begin if Assigned(Field.OnValidate) then begin Include(FRunState,drsInFieldValidate); try FValidatingFieldBuffer:=Buffer; {$ifdef D_27} Field.Validate(FValidatingFieldBuffer); {$else} FValidatedField:=Field; FValidatedRec:= ActiveRecord; Field.OnValidate(FValidatingFieldBuffer); {$endif} finally Exclude(FRunState,drsInFieldValidate); FValidatingFieldBuffer:=nil; end; end; end;

madorin commented 11 months ago

Fixed in #76