mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Fix crash with window creation in an event
This commit is contained in:
parent
556c407d20
commit
d2df9f3618
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user