App Being Killed with ThreadEndException

Hi

This is an unusual error I haven’t come across before.
I have a WebApp which runs some code on the server side continuously within a Thread, whilst the web interface effectively provides a means to control it.
The App is designed to run continuously until the user issues a shutdown via the web interface.
On short testing on my local windows machine the debug build seemed to work fine, however when I compiled for my Linux NAS Box (64-bit) and ran it on there, after approx. 8hours of unattended running the app seemed to crash/close itself.
I have code that writes out the unhandledexception event which caused the app to close and this caught a ThreadEndException but nothing else was on the stack at the time.

There was no user intervention to shut the app down so I’m assuming based on this exception that the Thread just stopped. Does anyone know why this might happen? Can the OS forcibly close a thread?
Short of running it in the IDE for 8 hours to see if it catches anything more specific I’m lost for ideas of what’s causing it.

Using Xojo 2016r3

You may be able to avoid the error by stopping the thread in the app close event.

The OS can close the app, but you got to take care of closing the thread yourself.

@Michel Bujardet
I already have code in the App.Close event to stop the thread and tidy things up before closing.
When the user closes the app through the intended way, this all goes smoothly and no errors are generated.

The problem is that the thread seems to be stopping itself after so many hours of running

[quote=385331:@Lawrence Johnson]@Michel Bujardet
I already have code in the App.Close event to stop the thread and tidy things up before closing.
When the user closes the app through the intended way, this all goes smoothly and no errors are generated.

The problem is that the thread seems to be stopping itself after so many hours of running[/quote]

is there any memory leaks?

@Derk Jochems
Not that I can tell.
There’s a large amount of memory available on the target system so it would have to be a particularly bad leak

I haven’t been able to re-produce the error running from the IDE and there’s no massive increase in memory usage when running the debug build on my desktop.