From d0463ca4b1dbeb3cd8e05a788a5e9839de33ef72 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Wed, 12 Mar 2025 00:17:52 +0000 Subject: [PATCH] Close data fd before control fd --- src/input/api/Wiimote/l2cap/L2CapWiimote.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input/api/Wiimote/l2cap/L2CapWiimote.cpp b/src/input/api/Wiimote/l2cap/L2CapWiimote.cpp index 7b68b695..bdadca50 100644 --- a/src/input/api/Wiimote/l2cap/L2CapWiimote.cpp +++ b/src/input/api/Wiimote/l2cap/L2CapWiimote.cpp @@ -30,8 +30,8 @@ L2CapWiimote::L2CapWiimote(int recvFd, int sendFd, bdaddr_t addr) L2CapWiimote::~L2CapWiimote() { - close(m_controlFd); close(m_dataFd); + close(m_controlFd); const auto& b = m_addr.b; cemuLog_logDebug(LogType::Force, "Wiimote at {:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x} disconnected", b[5], b[4], b[3], b[2], b[1], b[0]); @@ -101,8 +101,8 @@ std::vector L2CapWiimote::get_devices() const auto& b = addr.b; cemuLog_logDebug(LogType::Force, "Failed to connect recv socket to '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}': {}", b[5], b[4], b[3], b[2], b[1], b[0], strerror(errno)); - close(controlFd); close(dataFd); + close(controlFd); continue; } outDevices.emplace_back(std::make_shared(controlFd, dataFd, addr));