SenseApiMgr: Print dev info when detaching, use early return pattern

This commit is contained in:
2025-07-30 10:33:50 -04:00
parent a2598e80fd
commit 49c8b5bca1
+8 -6
View File
@@ -312,15 +312,17 @@ static int xcbWindow_detachDeviceReq(const smo::device::SenseDeviceSpec& spec)
} }
); );
if (it != g_attachedWindows.end()) if (it == g_attachedWindows.end())
{ {
g_attachedWindows.erase(it); std::cerr << __func__ << ": Device not found for detachment:\n"
std::cout << __func__ << ": Detached X11 window device\n"; << spec.stringify() << "\n";
return 0; return -1;
} }
std::cerr << __func__ << ": Device not found for detachment\n"; g_attachedWindows.erase(it);
return -1; std::cout << __func__ << ": Detached X11 window device:\n"
<< spec.stringify() << "\n";
return 0;
} }
// SenseApi descriptor // SenseApi descriptor