diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml
index 9b066072b..7dbaa53c6 100644
--- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml
+++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml
@@ -2538,22 +2538,6 @@
-
-
-
- false
- 0.0.0
-
-
- 3
- 0
- 0
- /dev/ttyS0
- 14
- 0
-
-
-
false
1.2.0
diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml
index a8dd2df63..0f9405f36 100644
--- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml
+++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml
@@ -2506,22 +2506,6 @@
-
-
-
- false
- 0.0.0
-
-
- 3
- 0
- 0
- /dev/ttyS0
- 14
- 0
-
-
-
false
1.2.0
diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp
index 55dc239a8..3fa7eaf9e 100644
--- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp
+++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp
@@ -239,8 +239,9 @@ void UAVGadgetInstanceManager::createOptionsPages()
m_pm->removeObject(m_optionsPages.takeLast());
}
- foreach (IUAVGadgetConfiguration *config, m_configurations)
- {
+ QMutableListIterator ite(m_configurations);
+ while (ite.hasNext()) {
+ IUAVGadgetConfiguration *config = ite.next();
IUAVGadgetFactory *f = factory(config->classId());
IOptionsPage *p = f->createOptionsPage(config);
if (p) {
@@ -249,6 +250,14 @@ void UAVGadgetInstanceManager::createOptionsPages()
m_optionsPages.append(page);
m_pm->addObject(page);
}
+ else {
+ qWarning()
+ << "UAVGadgetInstanceManager::createOptionsPages - failed to create options page for configuration "
+ + config->classId() + ":" + config->name() + ", configuration will be removed.";
+ // The m_optionsPages list and m_configurations list must be in synch otherwise nasty issues happen later
+ // so if we fail to create an options page we must remove the associated configuration
+ ite.remove();
+ }
}
}