05-23-2022, 08:28 AM
Hello,
in a IW form I create a TObjectList<T> in my CreateAndInit constructor.
The constructor call the inherited Create(AOwner) as its first instruction.
In the OnDestroy method I am freeing the TObjectList<T> calling TObjectList<T>.Free.
When I move from this form to another I call TIWAppForm(WebApplication.ActiveForm).Release and the destructor is executed in the right way.
The problem raises when I close the application cause it is shown an AV error which is not shown if I remove the freeing of the TObjectList<T> in the Destructor.
It seems the form is released another time when the application closes.
Any advice about how to remove my form variable avoiding the AV error when the application closes?
Thank you,
Davide
in a IW form I create a TObjectList<T> in my CreateAndInit constructor.
The constructor call the inherited Create(AOwner) as its first instruction.
In the OnDestroy method I am freeing the TObjectList<T> calling TObjectList<T>.Free.
When I move from this form to another I call TIWAppForm(WebApplication.ActiveForm).Release and the destructor is executed in the right way.
The problem raises when I close the application cause it is shown an AV error which is not shown if I remove the freeing of the TObjectList<T> in the Destructor.
It seems the form is released another time when the application closes.
Any advice about how to remove my form variable avoiding the AV error when the application closes?
Thank you,
Davide