diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 874ab9be13..f65c5377fc 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -583,6 +583,8 @@ void GraphicsEngine:: remove_all_windows() { Thread *current_thread = Thread::get_current_thread(); + ReMutexHolder holder(_lock, current_thread); + // Let's move the _windows vector into a local copy first, and walk through // that local copy, just in case someone we call during the loop attempts to // modify _windows. I don't know what code would be doing this, but it