From cc1fc53504f57ff92e49f9a38865b650f0147eca Mon Sep 17 00:00:00 2001
From: roangel <roangel@student.ethz.ch>
Date: Thu, 1 Jun 2017 16:54:57 +0200
Subject: [PATCH] maybe solved crash when we untick one CF in vicon? need to
 test

---
 pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp
index 409d5963..b4c039c0 100755
--- a/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp
+++ b/pps_ws/src/d_fall_pps/GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp
@@ -343,7 +343,7 @@ void MainGUIWindow::updateNewViconData(const ptrToMessage& p_msg) //connected to
     // in this loop, clean the ones that are not present anymore. UPDATE: this will apparently only happen when we tick and untick in Vicon
     int crazyfly_vector_size_after = crazyflies_vector.size();
 
-    for(int j = 0; j < crazyfly_vector_size_after; j++)
+    for(int j = crazyfly_vector_size_after - 1; j >= 0; j--)
     {
         bool name_found = false;
         for(int i = 0; i < p_msg->crazyflies.size(); i++)
-- 
GitLab