I use a separate thread for reading sensor-data.
The problem is that Unity editor environment does not abort threads that were spawned, they keep on running after stopping the application.
A practical solution could be to change the thread’s processing loop from:
while (true)
{
Thread.Sleep(100);
this.pm3.LowResolutionUpdate();
print("update");
}
to something like:
while (!quit)
{
Thread.Sleep(100);
this.pm3.LowResolutionUpdate();
print("update");
}
And set the shared variable “quit” from the main Unity thread before stopping the application. This quite clumsy, I would prefer all threads to be aborted when i stop the application. Is there a way to do this?