From 52cb2ef123993014470619d75679f352db43f8b1 Mon Sep 17 00:00:00 2001 From: Jarvis Huang Date: Wed, 27 Oct 2021 12:35:14 +0800 Subject: [PATCH] d/android: Stop thread function when device destoryed --- src/xrt/drivers/android/android_sensors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xrt/drivers/android/android_sensors.c b/src/xrt/drivers/android/android_sensors.c index 79f4bb238..050fbaaad 100644 --- a/src/xrt/drivers/android/android_sensors.c +++ b/src/xrt/drivers/android/android_sensors.c @@ -112,7 +112,7 @@ android_run_thread(void *ptr) } int ret = 0; - while (ret != ALOOPER_POLL_ERROR) { + while (d->oth.running && ret != ALOOPER_POLL_ERROR) { ret = ALooper_pollAll(0, NULL, NULL, NULL); }