Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Freeing form variable
#4
(05-27-2022, 12:48 AM)Alexandre Machado Wrote: Something doesn't look correct in this scenario. What's your IW version?

TIWAppForm(WebApplication.ActiveForm).Release won't call the destructor of the form immediately, only after the whole response has been generated. It would be good to know exactly if somehow in your case the destructor is called *immediately* after the call to Release (and no other code runs in between).

Also where exactly is TIWAppForm(WebApplication.ActiveForm).Release in relation to the code that creates and shows a new form?

Why don't you try to use what IW has built-in, instead of writing lots of code yourself?

You can simply call:

WebApplication.ShowForm(TIWForm1, True, True);

The first parameter is the class of the form

The second is a flag indicating if the Active form must be released afterwards (exactly what you want)

The third is another flag indicating if any existing TIWForm1 instance can be used instead of creating a new one (in most cases, True is the adequate choice)


Hi Alexandre,

I found the error that is not related to any IW form management but It was my error releasing an item of a list owned by the form I was releasing.
Thak you for your support and if you have time send me some advice about what I ask to you in my previous reply.

Greetings,
Davide
Reply


Messages In This Thread
Freeing form variable - by David1 - 05-23-2022, 08:28 AM
RE: Freeing form variable - by Alexandre Machado - 05-27-2022, 12:48 AM
RE: Freeing form variable - by David1 - 05-31-2022, 02:27 PM
RE: Freeing form variable - by David1 - 06-01-2022, 08:18 AM
RE: Freeing form variable - by Alexandre Machado - 06-03-2022, 10:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)