Fix crash when disabling expansion modules

This commit is contained in:
Georgii Surkov 2024-02-06 17:10:14 +03:00
parent 3721a71eab
commit ff28c23f64
No known key found for this signature in database
GPG key ID: 44A24455F6ADB5E7

View file

@ -107,15 +107,14 @@ static void
if(instance->state == ExpansionStateDisabled) {
return;
}
if(instance->state == ExpansionStateRunning) {
} else if(instance->state == ExpansionStateRunning) {
expansion_worker_stop(instance->worker);
expansion_worker_free(instance->worker);
} else {
furi_hal_serial_control_set_expansion_callback(instance->serial_id, NULL, NULL);
}
instance->state = ExpansionStateDisabled;
furi_hal_serial_control_set_expansion_callback(instance->serial_id, NULL, NULL);
FURI_LOG_D(TAG, "Detection disabled");
}