04-11-2023, 06:39 PM
Using Rad Studio 10.2.3 with Intraweb 15.2.69
I am trying to use the procedure described below to be sure that the session is really terminated after WebApplication->Terminate() is called.
https://www.atozed.com/2022/12/terminati...-sessions/
I use the code below:
void __fastcall TformMain::IWAppFormAsyncPageUnloaded(TObject *Sender, TStringList *EventParams,
bool AIsCurrent)
{
if (AIsCurrent && (WebApplication->ActiveFormCount == 1))
{
WebApplication->SelfDestruct();
}
}
If the user remains inactive more than 1 minute, or maybe less, on the landing page (main form) the application generates the exception attached.
I think the problem is related to the way this function works. The landing page is the only active form. And after the end of the internal timer, 15 s default, it tries to destruct the application even if the Terminate() function was not called.
Even if there is only one form active like in the case of the main form and the application timeout, which is 30 minutes or more, is not reached or Terminate() has not been called, this function should not be triggered!
It cannot rely only on the number of active forms, because the application can have more than 1 form still available and the timeout may have been reached or Terminate() called!
I am trying to use the procedure described below to be sure that the session is really terminated after WebApplication->Terminate() is called.
https://www.atozed.com/2022/12/terminati...-sessions/
I use the code below:
void __fastcall TformMain::IWAppFormAsyncPageUnloaded(TObject *Sender, TStringList *EventParams,
bool AIsCurrent)
{
if (AIsCurrent && (WebApplication->ActiveFormCount == 1))
{
WebApplication->SelfDestruct();
}
}
If the user remains inactive more than 1 minute, or maybe less, on the landing page (main form) the application generates the exception attached.
I think the problem is related to the way this function works. The landing page is the only active form. And after the end of the internal timer, 15 s default, it tries to destruct the application even if the Terminate() function was not called.
Even if there is only one form active like in the case of the main form and the application timeout, which is 30 minutes or more, is not reached or Terminate() has not been called, this function should not be triggered!
It cannot rely only on the number of active forms, because the application can have more than 1 form still available and the timeout may have been reached or Terminate() called!