Icon View Incident Report

Minor Minor
Reported By: Dhanashree Pathak
Reported On: 8/7/2007
For: Version 1.05 Build 1
# 2436 Setting Previously-Assigned OnFilterRecord Event to Nil Can Cause Access Violation

I have a lookup and on selecting the value I am getting Access Violation (AV).

Lookup table is not having OnFilterRecord event implemented.

I debuged the code and found that I am getting AV error on below part of the code in edbcomps.pas.

procedure TEDBDataset.RecordFilter(var Accept: Boolean);
var
   SaveState: TDataSetState;
begin
   SaveState:=SetTempState(dsFilter);
   try
      Accept:=True;
      OnFilterRecord(Self,Accept);  //This raises AV error
   except
      InternalHandleException;
   end;
   RestoreState(SaveState);
end;



Comments Comments
The AV was caused by the OnFilterRecord event being assigned a value with the Filtered property set to True, and then having the OnFilterRecord event assigned nil while keeping the Filtered property as True.


Resolution Resolution
Fixed Problem on 8/8/2007 in version 1.05 build 2
Image