From 4c4288f49174e915c70add242df1a1ff0bf00e08 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 17 Jan 2018 19:46:11 +0100 Subject: [PATCH] display: lock GraphicsEngine mutex in remove_all_windows() --- panda/src/display/graphicsEngine.cxx | 2 ++ 1 file changed, 2 insertions(+) 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