iOS上的LiveBindings内存泄漏

时间:2015-01-11 16:45:51

标签: delphi firemonkey delphi-xe7 livebindings

我使用此代码更改项目在运行时TListView上显示的方式:

// lvContacts: TListView
// cdsContacts: TClientDataSet with two records
// lcfContacts: TLinkListControlToField

lvContacts.Items.BeginUpdate;
dmLocalData.cdsContacts.DisableControls;
try
  lcfContacts.FillExpressions.Clear;
  if MultiDetailsView then
  begin
    lvContacts.ItemAppearance.ItemAppearance := 'MultiDetailItem';
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'PictureData';
      ControlMemberName := 'Bitmap';
    end;
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'Job';
      ControlMemberName := 'Detail';
    end;
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'email';
      ControlMemberName := 'Detail1';
    end;
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'mobilePhone';
      ControlMemberName := 'Detail2';
    end;
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'landLinePhone';
      ControlMemberName := 'Detail3';
    end;
  end else begin
    lvContacts.ItemAppearance.ItemAppearance := 'ImageListItemBottomDetail';
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'PictureData';
      ControlMemberName := 'Bitmap';
    end;
    with lcfContacts.FillExpressions.AddExpression do
    begin
      SourceMemberName := 'Job';
      ControlMemberName := 'Detail';
    end;
  end;
finally
  lvContacts.Items.EndUpdate;
  dmLocalData.cdsContacts.EnableControls;
end;

我使用Instruments在iPhone上监控我的应用程序,每次执行此代码时,我都会看到大约1千兆字节的泄漏TMoveArrayManager个实例。仅仅几次之后,我的iPhone内存不足并关闭了我的应用程序。我试图找到一种更好的方法来在运行时处理和创建实时绑定,但无法提出更好的解决方案。有没有人遇到过活动绑定这样的问题?

0 个答案:

没有答案