Maelstrom: Clear the game info after saving control preferences

https://github.com/libsdl-org/Maelstrom/commit/4d82a34696802708b8859dfd5ea6732809b7a860

From 4d82a34696802708b8859dfd5ea6732809b7a860 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 25 Nov 2011 08:50:43 -0500
Subject: [PATCH] Clear the game info after saving control preferences

---
 game/lobby.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/game/lobby.cpp b/game/lobby.cpp
index 22a8394c..20f88a4e 100644
--- a/game/lobby.cpp
+++ b/game/lobby.cpp
@@ -307,8 +307,6 @@ LobbyDialogDelegate::SetHostOrJoin(void*, int value)
 {
 	// This is called when the lobby switches from hosting to joining
 	HaltNetData();
-	ClearGameInfo();
-	ClearGameList();
 
 	if (value > 0) {
 		if (InitNetData(value == HOST_GAME) < 0) {
@@ -420,6 +418,11 @@ LobbyDialogDelegate::SetState(LOBBY_STATE state)
 		prefs->Save();
 	}
 
+	if (state == STATE_HOSTING || state == STATE_LISTING || state == STATE_NONE) {
+		ClearGameInfo();
+		ClearGameList();
+	}
+
 	if (state == STATE_NONE) {
 		if (m_state == STATE_HOSTING) {
 			// Notify the players that the game is gone