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