Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session memory leaks problem
#2
Hi VG0005,

I will not claim to know anything about any memory leak in IW but in a test I have created, where one form creates, show and destroy another form, where the purpose was to find out the order in which events appears, I have noticed a problem regarding destroying the main form.

In the simple application I add a line to the logfile, for every procedure or function called, and the general order is that I start the application, push a button on main form to create and show form2. On form2 I push a button to release form2 and return to form1. On form1 I then push a second button to terminate the application.

The logfile look like this:

11-08-2019 17:31:09
11-08-2019 17:31:09 UserSession.Create                    : 1
11-08-2019 17:31:09
11-08-2019 17:31:09 Unit1.FormCreate                      : 2
11-08-2019 17:31:09
11-08-2019 17:31:09 Unit1.FormShow                        : 3
11-08-2019 17:31:10
11-08-2019 17:31:10 Unit1.Button1.OnAsyncClick.BeforeCall  : 4
11-08-2019 17:31:10
11-08-2019 17:31:10 Unit2.FormCreate                      : 5
11-08-2019 17:31:10
11-08-2019 17:31:10 Unit2.FormShow                        : 6
11-08-2019 17:31:10
11-08-2019 17:31:10 Unit1.Button1.OnAsyncClick.AfterCall  : 7
11-08-2019 17:31:12
11-08-2019 17:31:12 Unit2.Button1.OnAsyncClick.BeforeCall  : 8
11-08-2019 17:31:12
11-08-2019 17:31:12 Unit1.FormShow                        : 9
11-08-2019 17:31:12
11-08-2019 17:31:12 Unit2.Button1.OnAsyncClick.AfterCall  : 10
11-08-2019 17:31:12
11-08-2019 17:31:12 Unit2.FormDestroy                      : 11
11-08-2019 17:31:13
11-08-2019 17:31:13 Unit1.Button2.Application.Terminate    : 12
11-08-2019 17:31:13
11-08-2019 17:31:13 UserSession.Destroy                    : 13


Notice that "Unit1.FormDestroy" is missing. I appears as if formdestroy is not called for the main form, when terminating the application.

But the thing is, MainForm.Destroy IS called, but ONLY the first line of the procedure is executed. I made a number of tests confirming the behavior: second and subsequent lines are not processed.

Whether or not this leads to memory leaks I cannot say, but it do mean that whatever application activity you have put in (main)form.Destroy, only the first line of code is executed.

Regards
Soren

NB! If anybody wants the test application, please let me know and I'll add it as a zip file. It's build with IW 15.1.3 and Delphi 10.3.2 Rio
Reply


Messages In This Thread
Session memory leaks problem - by vg0005 - 08-15-2019, 08:36 PM
RE: Session memory leaks problem - by SorenJensen - 08-16-2019, 06:02 AM
RE: Session memory leaks problem - by SorenJensen - 08-19-2019, 04:31 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)