mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
fix(rpc): ignore redraw events when exiting (#22184)
When a TUI client has already stopped, handling UI events will cause a heap-use-after-free, so ignore them.
This commit is contained in:
@@ -247,7 +247,8 @@ static void parse_msgpack(Channel *channel)
|
||||
Unpacker *p = channel->rpc.unpacker;
|
||||
while (unpacker_advance(p)) {
|
||||
if (p->type == kMessageTypeRedrawEvent) {
|
||||
if (ui_client_channel_id) {
|
||||
// When exiting, ui_client_stop() has already been called, so don't handle UI events.
|
||||
if (ui_client_channel_id && !exiting) {
|
||||
if (p->grid_line_event) {
|
||||
ui_client_event_raw_line(p->grid_line_event);
|
||||
} else if (p->ui_handler.fn != NULL && p->result.type == kObjectTypeArray) {
|
||||
|
Reference in New Issue
Block a user