mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
RPC: Fix input lockup on disconnect
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
- Archive: Fix favorite's parent folders thinking they are favorited too (by @Willy-JL)
|
||||
- FBT: Consistent version/branch info, fix gitorigin (by @Willy-JL)
|
||||
- AssetPacker: Pack pre-compiled icons and fonts too (by @Willy-JL)
|
||||
- OFW: RPC: Fix input lockup on disconnect (by @Willy-JL)
|
||||
- OFW: ELF/Flipper application: Do not crash on "out of memory" (by @DrZlo13)
|
||||
- OFW: JS: Disable logging in mjs +2k free flash (by @hedger)
|
||||
- OFW: NFC: Fixed infinite loop in dictionary attack scene (by @RebornedBrain)
|
||||
|
||||
@@ -477,6 +477,22 @@ void rpc_system_gui_free(void* context) {
|
||||
RpcGuiSystem* rpc_gui = context;
|
||||
furi_assert(rpc_gui->gui);
|
||||
|
||||
// Release ongoing inputs to avoid lockup
|
||||
for(InputKey key = 0; key < InputKeyMAX; key++) {
|
||||
if(rpc_gui->input_key_counter[key] != RPC_GUI_INPUT_RESET) {
|
||||
InputEvent event = {
|
||||
.key = key,
|
||||
.type = InputTypeRelease,
|
||||
.sequence_source = INPUT_SEQUENCE_SOURCE_SOFTWARE,
|
||||
.sequence_counter = rpc_gui->input_key_counter[key],
|
||||
};
|
||||
FuriPubSub* input_events = furi_record_open(RECORD_INPUT_EVENTS);
|
||||
furi_check(input_events);
|
||||
furi_pubsub_publish(input_events, &event);
|
||||
furi_record_close(RECORD_INPUT_EVENTS);
|
||||
}
|
||||
}
|
||||
|
||||
if(rpc_gui->virtual_display_view_port) {
|
||||
gui_remove_view_port(rpc_gui->gui, rpc_gui->virtual_display_view_port);
|
||||
view_port_free(rpc_gui->virtual_display_view_port);
|
||||
|
||||
Reference in New Issue
Block a user