Author: soliton
Date: Sat May 16 16:21:01 2009
New Revision: 35652

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35652&view=rev
Log:
check if we're missing to catch an exception

Modified:
    trunk/src/server/game.cpp

Modified: trunk/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.cpp?rev=35652&r1=35651&r2=35652&view=diff
==============================================================================
--- trunk/src/server/game.cpp (original)
+++ trunk/src/server/game.cpp Sat May 16 16:21:01 2009
@@ -94,13 +94,19 @@
 {
        // Hack to handle the pseudo games lobby_ and not_logged_in_.
        if (owner_ == 0) return;
-       save_replay();
-
-       user_vector users = all_game_users();
-       for (user_vector::const_iterator u = users.begin(); u != users.end(); 
++u) {
-               remove_player(*u, false, true);
-       }
-       clear_history();
+
+       try {
+               save_replay();
+
+               user_vector users = all_game_users();
+               for (user_vector::const_iterator u = users.begin(); u != 
users.end(); ++u) {
+                       remove_player(*u, false, true);
+               }
+               clear_history();
+       } catch (...) {
+               LOG_GAME << "Caught unknown error while destructing game:\t\""
+                       << name_ << "\" (" << id_ << ")\n";
+       }
 }
 
 bool game::allow_observers() const {


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to