Hi,
The following sometimes happens:
- In my application I'm using a lot of threads.
- Sometimes a thread is getting a problem, in my case I can simulate it by de-connecting the network plug. The thread is hanging because of the timeout on the network.
- I close the application with the normal procedure.
When I check the system afterwards, my application remains in the system processes. It looks as that blocked thread stays somewhere in memory.
Can I check all the threads when closing my application, and can I force them to close/destroy?
Application remains in system
Re: Application remains in system
Chris -
If a thread is still responding to events you can always push an event to it.
I use the below function to close all windows in all threads.
In eXpress++ build 259, I have improved the DC_InspectThreads() function to be able to display the stack and all work area information for all threads by using a similar technique.
If a thread is still responding to events you can always push an event to it.
I use the below function to close all windows in all threads.
Code: Select all
FUNCTION CloseAllWindows()
LOCAL i, aChildList, nSeconds := Seconds()
DO WHILE !Empty( aChildList := Set_MainWindow():drawingArea:childList())
FOR i := 1 TO Len(aChildList)
IF !aChildList[i]:isDerivedFrom('XbpDialog')
aChildList[i]:destroy()
ELSE
PostAppEvent(xbeP_Close,,,aChildList[i])
ENDIF
Sleep(10)
NEXT
IF Seconds() - nSeconds > 10
EXIT
ENDIF
ENDDO
Sleep(10)
RETURN nil
The eXpress train is coming - and it has more cars.
Re: Application remains in system
Hi Roger,
Set_MainWindow() seems to be a function which is not standard eXpress++? I'm getting an error when I try to compile your code: 'Unresolved external symbol'.
Set_MainWindow() seems to be a function which is not standard eXpress++? I'm getting an error when I try to compile your code: 'Unresolved external symbol'.
Re: Application remains in system
This was just a get-set function that pointed to the main window dialog object.
You can change it to AppDeskTop():childList()[1].
That should also point to the main window.
You can change it to AppDeskTop():childList()[1].
That should also point to the main window.
The eXpress train is coming - and it has more cars.