Ignore:
Timestamp:
Aug 17, 2016, 11:20:37 AM (8 years ago)
Author:
chronos
Message:
  • Modified: Do not initialize all forms at startup to save some memory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAcronym.pas

    r89 r95  
    7575  I: Integer;
    7676begin
    77   FormCategorySelect.Load(ListBoxCategories.Items);
    78   if FormCategorySelect.ShowModal = mrOk then begin
    79     for I := 0 to FormCategorySelect.ListBox1.Count - 1 do
    80       if FormCategorySelect.ListBox1.Selected[I] then begin
    81         ListBoxCategories.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);
    82       end;
     77  FormCategorySelect := TFormCategorySelect.Create(Self);
     78  try
     79    FormCategorySelect.Load(ListBoxCategories.Items);
     80    if FormCategorySelect.ShowModal = mrOk then begin
     81      for I := 0 to FormCategorySelect.ListBox1.Count - 1 do
     82        if FormCategorySelect.ListBox1.Selected[I] then begin
     83          ListBoxCategories.Items.AddObject(FormCategorySelect.ListBox1.Items[I], FormCategorySelect.ListBox1.Items.Objects[I]);
     84        end;
     85    end;
     86  finally
     87    FreeAndNil(FormCategorySelect);
    8388  end;
    8489end;
Note: See TracChangeset for help on using the changeset viewer.