Recent

Author Topic: Memory Not Released after saving DB file  (Read 2129 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Memory Not Released after saving DB file
« on: August 03, 2021, 11:33:43 am »
Hi,
I'm using TcsvDataSet just to save it as CSV file. (I know DBExport package, but just want to install minimum). 
Only when this procedure is executed there are memory blocks not released as in the attached file. Not sure whether this is DB issue or LCL issue.

bdsSampleList is TBufDataSet. I'm not using TCSVDataSet directly because other parts were done with TBufDataSet (recently found SavetoCSVFile procedure). 

Code: Pascal  [Select][+][-]
  1. procedure TSampleList.mniSaveClick(Sender: TObject);
  2. var
  3.    csv: TCSVDataSet;
  4. begin
  5.    if sd1.Execute then begin
  6.       csv:= TCSVDataSet.Create(nil);
  7.       with csv do begin
  8.          CopyFromDataset(bdsSampleList);
  9.          CSVOptions.FirstLineAsFieldNames:= True;
  10.          SaveToCSVFile(sd1.FileName);
  11.       end;
  12.       FreeAndNil(CSV);
  13.       ShowMessage('SampleList exported');
  14.    end;
  15. end;
  16.  
« Last Edit: August 03, 2021, 11:35:20 am by egsuh »

bytebites

  • Hero Member
  • *****
  • Posts: 632

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: Memory Not Released after saving DB file
« Reply #2 on: August 03, 2021, 02:39:09 pm »
I’m happy not to spend much time seaeching for my own mistake.

 

TinyPortal © 2005-2018