SDL: Fixed Android crash if sensors are opened while being quit

From bd0c0a9ce14dec4097dabdaad226a7c9447bdae5 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 26 Oct 2026 11:29:44 -0700
Subject: [PATCH] Fixed Android crash if sensors are opened while being quit

The sensor thread no longer blocks when the sensors are locked, so it's safe to keep holding that lock while shutting down.
---
 src/sensor/android/SDL_androidsensor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c
index 6baf3c2a07bb9..1fb284ce01a93 100644
--- a/src/sensor/android/SDL_androidsensor.c
+++ b/src/sensor/android/SDL_androidsensor.c
@@ -270,11 +270,9 @@ static void SDL_ANDROID_SensorClose(SDL_Sensor *sensor)
 
 static void SDL_ANDROID_SensorQuit(void)
 {
-    // All sensors are closed, but we need to unblock the sensor thread
+    // All sensors are closed, stop the sensor thread.
     SDL_AssertSensorsLocked();
-    SDL_UnlockSensors();
     SDL_ANDROID_StopSensorThread(&SDL_sensor_thread_context);
-    SDL_LockSensors();
 
     if (SDL_sensors) {
         SDL_free(SDL_sensors);