MSMK Posted February 5, 2019 Share Posted February 5, 2019 как правильно подчищать объекты, созданные в разделе MainModule, если сессия закончилась или был вызван UniSession.Logout? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 7, 2019 Share Posted February 7, 2019 Здравствуйте, Вам стоит позаботиться об уничтожении этих объектов в событии OnDestroy Quote Link to comment Share on other sites More sharing options...
MSMK Posted February 15, 2019 Author Share Posted February 15, 2019 On 2/7/2019 at 9:24 PM, Sherzod said: Здравствуйте, Вам стоит позаботиться об уничтожении этих объектов в событии OnDestroy не могу понять жизненный цикл сессии, сначала отрабатывает событие UniGUIMainModuleCreate, потом UniGUIMainModuleBeforeLogin и после почему то UniGUIMainModuleDestroy Quote Link to comment Share on other sites More sharing options...
MSMK Posted February 15, 2019 Author Share Posted February 15, 2019 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; Quote Link to comment Share on other sites More sharing options...
MSMK Posted February 15, 2019 Author Share Posted February 15, 2019 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.