Problem
TBoldTypeNameMapping.SetAsString in BoldTypeNameDictionary.pas calls Free (which is Self.Free) instead of vTmpList.Free. This destroys the mapping object itself and leaks the TStringList.
procedure TBoldTypeNameMapping.SetAsString(const Value: string);
var
vTmpList: TStringList;
begin
vTmpList := TStringList.Create;
try
vTmpList.CommaText := value;
// ... assigns all fields from vTmpList ...
finally
Free; // BUG: frees Self (TBoldTypeNameMapping)
end; // should be: vTmpList.Free
end;
Impact
Any code path that calls SetAsString (via the AsString property) crashes with an Access Violation:
- TBoldTypeNameDictionary.LoadFromFile
- TBoldTypeNameDictionary.LoadFromStringList
SaveToFile is unaffected (uses GetAsString).
Fix
Change Free to vTmpList.Free.
Problem
TBoldTypeNameMapping.SetAsString in BoldTypeNameDictionary.pas calls Free (which is Self.Free) instead of vTmpList.Free. This destroys the mapping object itself and leaks the TStringList.
Impact
Any code path that calls SetAsString (via the AsString property) crashes with an Access Violation:
SaveToFile is unaffected (uses GetAsString).
Fix
Change Free to vTmpList.Free.