diff --git a/src/events.cpp b/src/events.cpp index 87b560286e9b..e6bc4c7a9ccb 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -186,8 +186,8 @@ context::~context() // a new event context is created when e.g. a modal dialog is opened, and then // closed when that dialog is closed. Each context contains a list of the handlers // in that context. The current context is the one on the top of the stack. -// The global context must always be in the first position. -std::deque event_contexts; +// The global context must always be in the first position, so we initialize it here. +std::deque event_contexts(1); std::vector pump_monitors; diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index 4f5dd85ad4c8..6803126aab5e 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -1112,9 +1112,6 @@ int main(int argc, char** argv) sigaction(SIGCHLD, &terminate_handler, nullptr); #endif - // declare this here so that it will always be at the front of the event queue. - events::event_context global_context; - SDL_StartTextInput(); try {