# HG changeset patch # User sheepluva # Date 1319353313 -7200 # Node ID 1db2486e45f4bb6aab82d597d538b047073c1381 # Parent d0d666503fd5910337df5c711772ae0cb3748e56 potential fix for issue #217 (SigSegV while in game room in KillAllTeams - team list change?) diff -r d0d666503fd5 -r 1db2486e45f4 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sun Oct 23 01:47:44 2011 -0400 +++ b/QTfrontend/hwform.cpp Sun Oct 23 09:01:53 2011 +0200 @@ -455,6 +455,10 @@ void HWForm::OnPageShown(quint8 id, quint8 lastid) { + // with all those signals firing around make sure we don't switch a page + // at the same time in different threads + onPageShownMutex.lock(); + #ifdef USE_XFIRE updateXfire(); #endif @@ -479,6 +483,13 @@ ui.pageNetGame->pGameCFG->pMapContainer->mapDrawingFinished(); } + if (id == ID_PAGE_ROOMSLIST) { + if (hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills. + game->netSuspend = true; + game->KillAllTeams(); + } + } + if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) { QStringList tmNames = config->GetTeamsList(); TeamSelWidget* curTeamSelWidget; @@ -525,13 +536,11 @@ if (id == ID_PAGE_NETGAME) // joining a room ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text()); // joining the lobby - else if (id == ID_PAGE_ROOMSLIST) { - if (hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills. - game->netSuspend = true; - game->KillAllTeams(); - } + else if (id == ID_PAGE_ROOMSLIST) ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text()); - } + + + onPageShownMutex.unlock(); } void HWForm::GoToPage(int id) diff -r d0d666503fd5 -r 1db2486e45f4 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Sun Oct 23 01:47:44 2011 -0400 +++ b/QTfrontend/hwform.h Sun Oct 23 09:01:53 2011 +0200 @@ -20,6 +20,7 @@ #define HWFORM_H #include +#include #include #include @@ -168,12 +169,13 @@ BGWidget * wBackground; QSignalMapper * pageSwitchMapper; QByteArray m_lastDemo; + QMutex onPageShownMutex; #ifdef __APPLE__ InstallController * panel; #endif - void OnPageShown(quint8 id, quint8 lastid=0); + void OnPageShown(quint8 id, quint8 lastid=0); // thread-safe }; #endif