From 4211b7e971cd2b0e0295c18dc2751e66b0222046 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Wed, 28 Dec 2016 19:31:44 -0800 Subject: [PATCH] Link reference bug fixes --- src/comm/LinkManager.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index e014464d3..e2fad94e2 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -642,16 +642,15 @@ void LinkManager::_updateAutoConnectLinks(void) // Now remove all configs that are gone foreach (LinkConfiguration* pDeleteConfig, _confToDelete) { qCDebug(LinkManagerLog) << "Removing unused autoconnect config" << pDeleteConfig->name(); + if (pDeleteConfig->link()) { + disconnectLink(pDeleteConfig->link()); + } for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { if (_sharedAutoconnectConfigurations[i].data() == pDeleteConfig) { _sharedAutoconnectConfigurations.removeAt(i); break; } } - if (pDeleteConfig->link()) { - disconnectLink(pDeleteConfig->link()); - } - delete pDeleteConfig; } #endif #endif // NO_SERIAL_LINK -- 2.22.0