mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 10:02:10 +08:00
Fix access violation when using ASCIIencoding, by turning it from a SingleTon into a new instance each time we call GetEncodingByName. Probably introduces a memory leak. The encoding object is freed when using in a TStringStream context which is freed after usage. See exportgrid unit.
This commit is contained in:
@ -327,7 +327,6 @@ type
|
||||
var
|
||||
AppSettings: TAppSettings;
|
||||
MutexHandle: THandle = 0;
|
||||
ASCIIEncoding: TEncoding;
|
||||
|
||||
|
||||
implementation
|
||||
@ -2449,7 +2448,7 @@ begin
|
||||
Result := '';
|
||||
if Encoding = TEncoding.Default then
|
||||
Result := 'Windows-'+IntToStr(GetACP)
|
||||
else if Encoding = ASCIIEncoding then
|
||||
else if Encoding.CodePage = 437 then
|
||||
Result := 'ascii'
|
||||
else if Encoding = TEncoding.Unicode then
|
||||
Result := 'utf-16le'
|
||||
|
Reference in New Issue
Block a user