Icon View Incident Report

Serious Serious
Reported By: Elevate Software
Reported On: 8/26/1998
For: Version 1.03 Build 1
# 208 Memory Leak in Data Access Components Due to Improper Password Entry

I may have found one of J Peter's memory leaks. consider:

procedure TDBISAMDataSet.OpenCursor(InfoQuery: Boolean);
begin
FHandle:=CreateHandle;
if (FHandle=nil) then
DatabaseError(SHandleError);
inherited OpenCursor(InfoQuery);
end;

...if CreateHandle raises an exception (as it does in the case of an invalid password) then the excecution point will never return so, although FHandle remains nil, the DataBaseError and the inherited methos are never called. As a result when we get to:

procedure TDBISAMDataSet.CloseCursor;
begin
inherited CloseCursor;
if FHandle <> nil then
begin
DestroyHandle;
FHandle:=nil;
end;
end;

...DestroyHandle is not called and the TDataFile object is never freed. Memory leak.


Resolution Resolution
Fixed Problem on 8/27/1998 in version 1.04 build 1
Image