fpspreadsheet: Fix memory leak (ignored format string and dyn formula array when freeing cells)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2941 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2014-04-17 20:13:38 +00:00
parent 1f84822607
commit 89942f1bd3

View File

@ -557,9 +557,11 @@ end;
}
procedure TsWorksheet.RemoveCallback(data, arg: pointer);
begin
{ The UTF8STring must be manually reseted to nil content, because
{ The strings and dyn arrays must be reset to nil content manually, because
FreeMem only frees the record mem, without checking its content }
PCell(data).UTF8StringValue:='';
PCell(data).UTF8StringValue := '';
PCell(data).NumberFormatStr := '';
SetLength(PCell(data).RPNFormulaValue, 0);
FreeMem(data);
end;