Program not closing completely

derez

Expert
Licensed User
Longtime User
Hi !
Can anyone tell me what may be the reason for a program to leave a process runing after closing ?

I see the attached list of processes, the small one of "Nivut" is a leftover from the program after running and closing, the larger is the program running (after re launching it).

I checked that no files opened are left un-closed. any other reason ?
(the total code is too large to attach)
 

derez

Expert
Licensed User
Longtime User
I found the cause of the problem - but I can't understand the reason.
I have a NUMUPDOWN control to select a number from 0 to 12.

When I removed it and replaced it with combobox - the problem disappeared.

The code for the control (from the design part):

B4X:
addnum(portpanel,Hourupdn,95,160,50,2,12,255,255,255,True,True)@

The problem exist even if I mark all the line codes refering to this control in the program.
 

derez

Expert
Licensed User
Longtime User
Already tried it with no success...

Can it be related to the size of the program ? or number of controls ? this was probably the last control I added.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Already tried it with no success...

Can it be related to the size of the program ? or number of controls ? this was probably the last control I added.

The number of controls is only limited by the available memory. Are you running low on memory?
This case is pretty strange. The OS should not allow more than one instance of the same application running.
Can you somehow add some logging to your application (like writing some events to a file, or showing a message box)?
 

derez

Expert
Licensed User
Longtime User
The program size (exe file) is 1.2 MB, when running it uses 1.4 MB of memory while no map is loaded. There is still a lot of free memory .

The problem happens even if I just launch the application and immediately turn it off (so it hasn't loaded any map except for the opening screen).

I can add a sub to record anything within the cycle which is about 1-2 seconds, or during the app_start execution.

Tell me what you want to catch, I have no idea.
 
Last edited:

derez

Expert
Licensed User
Longtime User
I reduced the program to the minimum - it has just one form, one control and two code lines:
B4X:
#Region Initialization
Sub app_start
Sip(False)
form2.Show 
End Sub
#End Region

If I remove the SIP or the control - it does not have the problem.
 

derez

Expert
Licensed User
Longtime User
Mine is Mio 350 with WM5 , and it has Hebrew installed. The Hebrew has an effect on the IDE - I cannot edit the forms, just the code.

To see the problem I just have to run the program, close the form and then look at the task manager to see if there is a process running.

I tried it on WM6 emulator - it doesn't happen there.
 
Last edited:
Top