I simplify the situation:
Code: Select all
type
eColType = ( eUnused, eText, eInteger, eCheckBox, eColorDlg );
tCellInfo = record
Text : string;
case CellType:eColType of
eInteger : ( Count : integer );
eCheckBox : ( Checked : boolean );
eColorDlg : ( Color : tColor );
end; {tCellInfo}
function Fill( var pCellInfo : tCellInfo ) : boolean;
begin
...
pCellInfo.Text := 'Text'; //<-- this is reported by madexcept
...
end;
It seems so whether the string in the record is the problem. After changing it to a shortstring madExcept doesn't report the leak anymore. But i need a string.madExceptDbg 1575 GetMemCallback
System 51 @GetMem
System 51 @NewUnicodeString
System 51 @UStrFromPWCharLen
System 51 @UStrCopy
System.Classes TStrings.GetValue
What can I do to keep the string and have no memory leak?!