From c0798d1bdb7668ed1707834290f8ff7bd5b77912 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Sun, 28 Sep 2025 13:04:07 -0400 Subject: [PATCH] DevMgr: detachAll only detaches from attachedDeviceRoles We no longer try to detach from the collection of specs. We detach from the collection of attachedDeviceRoles. This means our cleanup sequence no longer tries to clean up things that were never set up to begin with. --- smocore/deviceManager/deviceManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smocore/deviceManager/deviceManager.cpp b/smocore/deviceManager/deviceManager.cpp index cf2a6b9..b4100be 100644 --- a/smocore/deviceManager/deviceManager.cpp +++ b/smocore/deviceManager/deviceManager.cpp @@ -602,10 +602,10 @@ public: [[maybe_unused]] std::shared_ptr context ) { - for (const auto& spec : DeviceManager::deviceAttachmentSpecs) + for (const auto& deviceRole : DeviceManager::attachedDeviceRoles) { DeviceManager::getInstance().detachSenseDeviceReq( - spec, + deviceRole->deviceAttachmentSpec, {context, std::bind( &DetachAllAttachedDeviceRoles::detachAllAttachedDeviceRoles2, context.get(), context, @@ -649,7 +649,7 @@ void DeviceManager::detachAllAttachedDeviceRoles( Callback cb ) { - if (DeviceManager::getInstance().deviceAttachmentSpecs.size() == 0) + if (DeviceManager::getInstance().attachedDeviceRoles.size() == 0) { AsynchronousLoop tmp(0); cb.callbackFn(tmp); @@ -658,7 +658,7 @@ void DeviceManager::detachAllAttachedDeviceRoles( const auto& caller = ComponentThread::getSelf(); auto request = std::make_shared( - DeviceManager::getInstance().deviceAttachmentSpecs.size(), + DeviceManager::getInstance().attachedDeviceRoles.size(), caller, std::move(cb)); mrntt::mrntt.thread->getIoService().post(