Skip to content

Commit d20c87a

Browse files
committed
Snes classic, make device list fail properly if in a bugged connecting state (even after close)
1 parent 811200c commit d20c87a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

devices/snesclassicfactory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ bool SNESClassicFactory::asyncListDevices()
441441
if (socket->state() == QAbstractSocket::ConnectingState)
442442
{
443443
sDebug() << "This should not happen, socket already trying to connect";
444+
checkFailed(Error::DeviceFactoryError::DFE_SNESCLASSIC_NO_DEVICE);
444445
return false;
445446
}
446447
if (socket->state() == QAbstractSocket::UnconnectedState)
@@ -453,7 +454,7 @@ bool SNESClassicFactory::asyncListDevices()
453454
sDebug() << "Timeout " << socket->state();
454455
if (socket->state() == QAbstractSocket::ConnectingState)
455456
{
456-
socket->close();
457+
socket->disconnectFromHost();
457458
this->checkFailed(Error::DeviceFactoryError::DFE_SNESCLASSIC_NO_DEVICE);
458459
}
459460
});

0 commit comments

Comments
 (0)