mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 12:08:33 +00:00
event: Only process if event_init has been run.
Reported by @fourjay, a codepath that causes event_poll() to run before event_init() will trigger a segfault as the events list will not have been initialized. Exiting immediately from event_init() causes nvim to hang, so just exit before running the events. fixes #2339
This commit is contained in:
@@ -124,7 +124,11 @@ void event_poll(int ms)
|
||||
}
|
||||
|
||||
recursive--; // Can re-enter uv_run now
|
||||
process_events_from(immediate_events);
|
||||
|
||||
// In case this is run before event_init, don't process any events.
|
||||
if (immediate_events) {
|
||||
process_events_from(immediate_events);
|
||||
}
|
||||
}
|
||||
|
||||
bool event_has_deferred(void)
|
||||
|
Reference in New Issue
Block a user