fpspreadsheet: Fix memory leak occuring when the parser of a previously allocated formula record is changed.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6521 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-06-21 10:02:25 +00:00
parent b2cc14f2bc
commit ab52825725

View File

@@ -1490,6 +1490,7 @@ begin
if Result = nil then
Result := PsFormula(Add(ARow, ACol));
Result^.Text := AFormula; // unparsed formula
FreeAndNil(Result^.Parser); // Destroy previously existing parser
Result^.Parser := AParsedFormula; // if nil, will be parsed on next calculation
Result^.CalcState := csNotCalculated;
end;