mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 14:20:05 +02:00
* fcl-db: bufdataset: free up cached blob buffers in unidirectional mode; alternate solution to issue #24509. Patch by Laco.
git-svn-id: trunk@27925 -
This commit is contained in:
parent
95a1a2552c
commit
e9f99fb3d2
@ -4021,8 +4021,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TUniDirectionalBufIndex.AddRecord;
|
||||
var
|
||||
h,i: integer;
|
||||
begin
|
||||
// Do nothing
|
||||
// Release unneeded blob buffers, in order to save memory
|
||||
// TDataSet has own buffer of records, so do not release blobs until they can be referenced
|
||||
with FDataSet do
|
||||
begin
|
||||
h := high(FBlobBuffers) - BufferCount*BlobFieldCount;
|
||||
if h > 10 then //Free in batches, starting with oldest (at beginning)
|
||||
begin
|
||||
for i := 0 to h do
|
||||
FreeBlobBuffer(FBlobBuffers[i]);
|
||||
FBlobBuffers := Copy(FBlobBuffers, h+1, high(FBlobBuffers)-h);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TUniDirectionalBufIndex.InsertRecordBeforeCurrentRecord(const ARecord: TRecordBuffer);
|
||||
|
Loading…
Reference in New Issue
Block a user