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:
Scott Prager
2015-04-03 12:35:12 -04:00
parent edbc9e6538
commit 93a3e331a3

View File

@@ -124,7 +124,11 @@ void event_poll(int ms)
}
recursive--; // Can re-enter uv_run now
// 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)