diff --git a/src/ui/QGCHilConfiguration.cc b/src/ui/QGCHilConfiguration.cc index d6253cefbc4f6f55da997e684b3bb2d4a9778b74..854699b044a99971c76c417198bfc891658834cf 100644 --- a/src/ui/QGCHilConfiguration.cc +++ b/src/ui/QGCHilConfiguration.cc @@ -24,6 +24,14 @@ QGCHilConfiguration::~QGCHilConfiguration() void QGCHilConfiguration::on_simComboBox_currentIndexChanged(int index) { + //clean up + QLayoutItem *child; + while ((child = ui->simulatorConfigurationLayout->takeAt(0)) != 0) + { + delete child->widget(); + delete child; + } + if(1 == index) { // Ensure the sim exists and is disabled