Commit fd2ec58
[SubGHz] Fix crash when exiting CLI
* [SubGHz] Fix crash when exiting CLI `subghz chat` with external CC1101
Pressing Ctrl+C to exit `subghz chat` while using an external CC1101
crashed the Flipper (null-pointer dereference + reboot).
The exit path called subghz_devices_deinit() before stopping the chat
worker. deinit unloads the external CC1101 radio-device plugin, freeing
its SubGhzDevice struct and interconnect vtable; the TxRx worker thread
sleeps/ends that device from its own thread on shutdown, so joining it
after deinit dereferenced freed plugin memory. The internal CC1101 is a
static device that deinit never frees, which is why the crash was
external-only.
Stop and free the worker before subghz_devices_deinit(), matching the
teardown order already used by subghz_cli_command_rx. Also add the
missing deinit + radio power-off to the "tx not allowed" early return so
a subsequent subghz command's subghz_devices_init() does not
furi_check-fail on an already-valid registry.
Fixes #829
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* changelog: SubGHz crash exiting CLI chat with external CC1101 (PR #1036, Fixes #829)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>subghz chat with external CC1101 (#1036)1 parent e4e8a8e commit fd2ec58
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
| 969 | + | |
| 970 | + | |
969 | 971 | | |
970 | 972 | | |
971 | 973 | | |
| |||
1113 | 1115 | | |
1114 | 1116 | | |
1115 | 1117 | | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1116 | 1125 | | |
1117 | 1126 | | |
1118 | 1127 | | |
1119 | 1128 | | |
1120 | 1129 | | |
1121 | 1130 | | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | 1131 | | |
1127 | 1132 | | |
1128 | 1133 | | |
| |||
0 commit comments