I think the background thread never terminates because stopBackgroundUpdates() just sets the running flag that is checked in a while loop. But _getNexEventRaw() blocks until there is an event. So, after stopBackgroundUpdates() is called, there needs to be one last event (i.e. a button press) until the flag is checked and the thread actually terminates.
Does anybody have a good idea on how to gracefully stop the update thread? (Ctrl-C works to just terminate the process, but that is not very nice.)
Hi,
I think the background thread never terminates because
stopBackgroundUpdates()
just sets therunning
flag that is checked in a while loop. But_getNexEventRaw()
blocks until there is an event. So, afterstopBackgroundUpdates()
is called, there needs to be one last event (i.e. a button press) until the flag is checked and the thread actually terminates.Does anybody have a good idea on how to gracefully stop the update thread? (Ctrl-C works to just terminate the process, but that is not very nice.)