Fix SDR device not released on GSM Spy stop

stop_scanner() cleared gsm_spy_active_device without calling
release_sdr_device(), so the device stayed claimed in the registry.
The scanner thread's finally block then saw None and skipped release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-08 15:43:06 +00:00
parent f5021a0fdf
commit 48795f6ec3

View File

@@ -493,8 +493,10 @@ def stop_scanner():
killed.append('monitor')
app_module.gsm_spy_monitor_process = None
# Note: SDR device is released by scanner thread's finally block
# to avoid race condition. Just reset the state variables here.
# Release SDR device from registry
if app_module.gsm_spy_active_device is not None:
from app import release_sdr_device
release_sdr_device(app_module.gsm_spy_active_device)
app_module.gsm_spy_active_device = None
app_module.gsm_spy_selected_arfcn = None
gsm_connected = False