Mysterious thread exiting / WE

Debugging this at the moment, but here is something worth making a note of:

I have an assignment statement in a thread and a recordset, the recordset is in scope and valid, socketclients is an array of sockets. (BTW This code works outside a thread)

mystring= str(rs.Field(“qtymax”).Int64Value*webpage.sockclients.ubound)

other code

When Xojo WE hits the mystring= line , it exits the thread, does not run other code, nor does it crash or raise an exception! the debugger steps directly out of the thread and continues the APP like it hit an imaginary return

Took a while to find. Building a demo example for feedback.

What you’re seeing is probably a context switch. Remember, each request from a browser is handled in another thread which can be brought to the foreground to run at any time.