Qt: Fix some new SIO cleanup issues

This commit is contained in:
Vicki Pfau 2024-10-08 04:32:43 -07:00
parent 2ccfde0f33
commit 7e474db93a
1 changed files with 7 additions and 1 deletions

View File

@ -192,6 +192,9 @@ MultiplayerController::MultiplayerController() {
MultiplayerController::~MultiplayerController() { MultiplayerController::~MultiplayerController() {
mLockstepDeinit(&m_lockstep); mLockstepDeinit(&m_lockstep);
if (m_platform == mPLATFORM_GBA) {
GBASIOLockstepCoordinatorDeinit(&m_gbaCoordinator);
}
} }
bool MultiplayerController::attachGame(CoreController* controller) { bool MultiplayerController::attachGame(CoreController* controller) {
@ -376,7 +379,7 @@ void MultiplayerController::detachGame(CoreController* controller) {
if (p.attached) { if (p.attached) {
GBASIOLockstepCoordinatorDetach(&m_gbaCoordinator, p.node.gba); GBASIOLockstepCoordinatorDetach(&m_gbaCoordinator, p.node.gba);
} }
delete p.node.gba->user; delete reinterpret_cast<LockstepUser*>(p.node.gba->user);
delete p.node.gba; delete p.node.gba;
break; break;
} }
@ -417,6 +420,9 @@ void MultiplayerController::detachGame(CoreController* controller) {
m_pids.remove(pid); m_pids.remove(pid);
if (m_pids.size() == 0) { if (m_pids.size() == 0) {
if (m_platform == mPLATFORM_GBA) {
GBASIOLockstepCoordinatorDeinit(&m_gbaCoordinator);
}
m_platform = mPLATFORM_NONE; m_platform = mPLATFORM_NONE;
} else { } else {
fixOrder(); fixOrder();