Changeset 38 for trunk/Forms


Ignore:
Timestamp:
Mar 8, 2012, 3:40:45 PM (13 years ago)
Author:
chronos
Message:
  • Fixed: SqlDatabase object initialized twice and freed once.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UImportStructureForm.pas

    r21 r38  
    9494procedure TImportStructureForm.FormShow(Sender: TObject);
    9595begin
    96   EditHost.Text := Core.SqlDatabase1.HostName;
    97   EditUser.Text := Core.SqlDatabase1.UserName;
    98   EditSchema.Text := Core.SqlDatabase1.Database;
     96  EditHost.Text := Core.System.Client.Host;
     97  EditUser.Text := Core.System.Client.User;
     98  EditSchema.Text := Core.System.Client.Schema;
    9999end;
    100100
  • trunk/Forms/UMainForm.pas

    r37 r38  
    170170procedure TMainForm.FormDestroy(Sender: TObject);
    171171begin
    172   Report.Free;
    173   TreeState.Free;
    174   PersistentForm.Free;
     172  FreeAndNil(Report);
     173  FreeAndNil(TreeState);
     174  FreeAndNil(PersistentForm);
    175175end;
    176176
     
    254254procedure TMainForm.AConnectExecute(Sender: TObject);
    255255begin
     256  try
     257    LoginForm := TLoginForm.Create(MainForm);
    256258  Core.Profiles.LoadFromRegistry(Core.RegistryRootKey, Core.RegistryKey);
    257259  if LoginForm.ShowModal = mrOK then begin
     
    273275    end;
    274276  end;
     277  finally
     278    LoginForm.Free;
     279  end;
    275280end;
    276281
     
    304309procedure TMainForm.MenuItem17Click(Sender: TObject);
    305310begin
    306   LoginForm.ShowModal;
     311  try
     312    LoginForm := TLoginForm.Create(MainForm);
     313    LoginForm.ShowModal;
     314  finally
     315    LoginForm.Free;
     316  end;
    307317end;
    308318
Note: See TracChangeset for help on using the changeset viewer.