Skip to content

Commit 117cdc0

Browse files
authored
Merge pull request #63 from GeneralsOnlineDevelopmentTeam/seer/fix-gamespy-race
GameSpy: Fix race condition in RefreshGameList
2 parents 0b28b33 + 3c884ed commit 117cdc0

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

‎GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,17 +1066,10 @@ void RefreshGameListBox( GameWindow *win, Bool showMap )
10661066
}
10671067
*/
10681068

1069-
clearBuddyGames();
1070-
1071-
// restore selection
1072-
GadgetListBoxSetSelected(win, indexToSelect); // even for -1, so we can disable the 'Join Game' button
1073-
// if(prevPos > 10)
1074-
GadgetListBoxSetTopVisibleEntry( win, prevPos );//+ 1
1075-
1076-
if (indexToSelect < 0 && selectedID)
1077-
{
1078-
TheWindowManager->winSetLoneWindow(NULL);
1079-
}
1069+
// Note: clearBuddyGames(), GadgetListBoxSetSelected(), and GadgetListBoxSetTopVisibleEntry()
1070+
// are now handled inside the SearchForLobbies callback above (after async operation completes).
1071+
// The code below was removed to fix a race condition where these operations executed on the
1072+
// empty/reset listbox before the async callback populated it, causing crashes.
10801073
}
10811074

10821075
void RefreshGameInfoListBox( GameWindow *mainWin, GameWindow *win )

0 commit comments

Comments
 (0)