Ignore:
Timestamp:
Mar 8, 2012, 3:40:45 PM (13 years ago)
Author:
chronos
Message:
  • Fixed: SqlDatabase object initialized twice and freed once.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.