Go to English page

ViaThinkSoft CodeLib

Dieser Artikel befindet sich in:

The following record will cause memory corruptions (can be detected with FastMM4) because the reference counting of the string inside the record is not correctly handled anymore.

  TBuggy = record
    MyString: string;

Following change will fix the issue:

  TWorking = record
    Dummy: Cardinal;
    MyString: string;

Any additional member to the record will fix the issue.

Tested with Delphi 2007 Professional.
Daniel Marschall
ViaThinkSoft Mitbegründer, Security Management
ViaThinkSoft Co-Founder, Security Management