Fix crash with window creation in an event

This commit is contained in:
rdb 2009-04-03 18:27:01 +00:00
parent 556c407d20
commit d2df9f3618

View File

@ -1517,10 +1517,11 @@ make_contexts(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
////////////////////////////////////////////////////////////////////
void GraphicsEngine::
process_events(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
Windows::const_iterator wi;
for (wi = wlist.begin(); wi != wlist.end(); ++wi) {
GraphicsOutput *win = (*wi);
win->process_events();
// We're not using a vector iterator here, since it's possible that
// the window list changes in an event, which would invalidate the
// iterator and cause a crash.
for (int i = 0; i < wlist.size(); ++i) {
wlist[i]->process_events();
}
}