Fixed: Access Violation in LoadFromString methods when not passing an Encoding explicitly
This commit is contained in:
parent
8feb95edb4
commit
fe7f2eb952
@ -74,7 +74,12 @@ const
|
|||||||
' stream: TStringStream;' + CrLf +
|
' stream: TStringStream;' + CrLf +
|
||||||
'' + CrLf +
|
'' + CrLf +
|
||||||
'begin' + CrLf +
|
'begin' + CrLf +
|
||||||
' stream := TStringStream.Create(AString{$IF CompilerVersion >= 20}, AEncoding, AOwnsEncoding{$IFEND});' + CrLf +
|
' {$IF CompilerVersion >= 20}' + CrLf +
|
||||||
|
' if Assigned(AEncoding) then' + CrLf +
|
||||||
|
' stream := TStringStream.Create(AString, AEncoding, AOwnsEncoding)' + CrLf +
|
||||||
|
' else' + CrLf +
|
||||||
|
' {$IFEND}' + CrLf +
|
||||||
|
' stream := TStringStream.Create(AString);' + CrLf +
|
||||||
' try' + CrLf +
|
' try' + CrLf +
|
||||||
' Result := Load%<Name>:sFromStream(stream);' + CrLf +
|
' Result := Load%<Name>:sFromStream(stream);' + CrLf +
|
||||||
' finally' + CrLf +
|
' finally' + CrLf +
|
||||||
|
Loading…
Reference in New Issue
Block a user