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.
This commit is contained in:
@@ -602,10 +602,10 @@ public:
|
||||
[[maybe_unused]] std::shared_ptr<DetachAllAttachedDeviceRoles> 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<detachAllAttachedDeviceRolesCbFn> 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<DetachAllAttachedDeviceRoles>(
|
||||
DeviceManager::getInstance().deviceAttachmentSpecs.size(),
|
||||
DeviceManager::getInstance().attachedDeviceRoles.size(),
|
||||
caller, std::move(cb));
|
||||
|
||||
mrntt::mrntt.thread->getIoService().post(
|
||||
|
||||
Reference in New Issue
Block a user