Code: Select all
procedure TRVFontInfoCacheFast.Clear;
var
CacheItem: TRVFontInfoCacheItem;
i: Integer;
begin
{ -- Begin Added Lines -- }
if Assigned(FInvalidItem) and Assigned(FInvalidItem.Canvas) then
FRVStyle.GraphicInterface.DestroyCompatibleCanvas(FInvalidItem.Canvas);
{ -- End Added Lines -- }
for i := 0 to Count-1 do
if Get(i) <> nil then begin
CacheItem := Get(i);
FRVStyle.GraphicInterface.DestroyCompatibleCanvas(CacheItem.Canvas);
end;
inherited Clear;
end;