Memory Leakage

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Mickey
Posts: 1
Joined: Fri Dec 20, 2013 6:09 am

Memory Leakage

Post by Mickey »

Delphi XE2 Update 4 memory leakage report as following:

21 - 28 bytes: TXc12Selections x 1, TXc12PivotSelections x 1
45 - 52 bytes: TXc12Pane x 1
69 - 76 bytes: TXc12SheetView x 1

Version: 5.20.10

Sample Code:
procedure TForm6.Button1Click(Sender: TObject);
var x : TXLSReadWriteII5;
begin
x := TXLSReadWriteII5.Create(self);
try
x.Version := xvExcel97;
x.Filename:= 'test.xls';
x.Sheets[0].Name := 'Sheet1';
x.Sheets[0].Clear;
x.Sheets[0].AsString[0, 0] := 'Col1';
x.Sheets[0].AsString[1, 0] := 'Col2';
x.Write;
finally
x.Free;
end;
end;
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Memory Leakage

Post by larsa »

Hello

This will be fixed in the next update.

The problem is "x.Sheets[0].Clear;" You don't have to call Clear when creating a new object.
Lars Arvidsson, Axolot Data
Post Reply