Browse Source

Fix crash by end iterator while closing a window

Younguk Kim 8 years ago
parent
commit
84bdce01f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      panda/src/display/graphicsEngine.cxx

+ 1 - 1
panda/src/display/graphicsEngine.cxx

@@ -529,7 +529,7 @@ remove_window(GraphicsOutput *window) {
   // Also check whether it is in _new_windows.
   {
     MutexHolder new_windows_holder(_new_windows_lock, current_thread);
-    _new_windows.erase(std::remove(_new_windows.begin(), _new_windows.end(), ptwin));
+    _new_windows.erase(std::remove(_new_windows.begin(), _new_windows.end(), ptwin), _new_windows.end());
   }
 
   if (count == 0) {