Lazarus

Programming => Databases => Topic started by: egsuh on August 03, 2021, 11:33:43 am

Title: Memory Not Released after saving DB file
Post by: egsuh 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.  
Title: Re: Memory Not Released after saving DB file
Post by: bytebites on August 03, 2021, 01:12:38 pm
https://forum.lazarus.freepascal.org/index.php?topic=49096.0
Title: Re: Memory Not Released after saving DB file
Post by: egsuh on August 03, 2021, 02:39:09 pm
I’m happy not to spend much time seaeching for my own mistake.
TinyPortal © 2005-2018