-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working