From ad2e65511423bc148771005f766bced58eac2a2a Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Sun, 16 Feb 2003 02:45:36 +0000
Subject: [PATCH] Fixed bug if in a menu when the game ends

---
 src/stratagus/mainloop.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/stratagus/mainloop.cpp b/src/stratagus/mainloop.cpp
index 1fb404ab9..255444d3a 100644
--- a/src/stratagus/mainloop.cpp
+++ b/src/stratagus/mainloop.cpp
@@ -797,6 +797,12 @@ global void GameMainLoop(void)
 	}
     }
 
+    if( Callbacks==&MenuCallbacks ) {
+	while( CurrentMenu ) {
+	    EndMenu();
+	}
+    }
+
     //
     //	Game over
     //