delphi string leak

前端 未结 4 2072
抹茶落季
抹茶落季 2020-12-18 00:59

I\'m working with Delphi XE, and writing an application that is using RemObjects SDK to communicate (in case that may be relevant). I have FastMM debug on, and sometimes (no

4条回答
  •  北海茫月
    2020-12-18 01:21

    You can leak strings by freeing records on the heap using FreeMem instead of Dispose or if you overwrite a record using System.Move or FillChar. In the first case the finalization code isn't run and in the second if the string field was filled with a nil it will think it's already cleared it.

    If you want to find the location for the leak download FastMM and turn on FullDebugMode. It will include a stack trace of where the leak occurred.

提交回复
热议问题