diff --git a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp index 3ef94f45d9bff9f8521c9eadc7317639f7586534..0b5826a8975afca18a2b4181238b20e2d3a0fb18 100644 --- a/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp +++ b/source/RobotAPI/components/ArViz/Coin/Visualizer.cpp @@ -507,6 +507,12 @@ namespace coin // Layer is currently visible if (!visible) { + // If we hide a layer wit a selected element, Coin will crash during rendering + // So we check if the selected element is in the layer to be hidden + if (selectedElement && selectedElement->layer == id) + { + selection->deselectAll(); + } root->removeChild(childIndex); } }