Jump to content

uniMainModule


MSMK

Recommended Posts

On 2/7/2019 at 9:24 PM, Sherzod said:

Здравствуйте,

Вам стоит позаботиться об уничтожении этих объектов в событии OnDestroy

не могу понять жизненный цикл сессии, сначала отрабатывает событие UniGUIMainModuleCreate, потом UniGUIMainModuleBeforeLogin и после почему то UniGUIMainModuleDestroy

Link to comment
Share on other sites

Just now, =GGG= said:

не могу понять жизненный цикл сессии, сначала отрабатывает событие UniGUIMainModuleCreate, потом UniGUIMainModuleBeforeLogin и после почему то UniGUIMainModuleDestroy

procedure TClient.UniGUIMainModuleCreate(Sender: TObject);
begin
       Settings := TSettings.Create;     

end;

procedure TClient.UniGUIMainModuleBeforeLogin(Sender: TObject;
  var Handled: Boolean);
begin
        Settings.CurrentUserInfo.Clear;
end;

procedure TClient.UniGUIMainModuleDestroy(Sender: TObject);
begin  

        if Assigned(Settings) then

                  Settings.Free;

end;

 

Link to comment
Share on other sites

6 minutes ago, =GGG= said:

procedure TClient.UniGUIMainModuleCreate(Sender: TObject);
begin
       Settings := TSettings.Create;     

end;

procedure TClient.UniGUIMainModuleBeforeLogin(Sender: TObject;
  var Handled: Boolean);
begin
        Settings.CurrentUserInfo.Clear;
end;

procedure TClient.UniGUIMainModuleDestroy(Sender: TObject);
begin  

        if Assigned(Settings) then

                  Settings.Free;

end;

 

 public
    { Public declarations }

    Settings: TSettings;
 
  end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...