From cd27c8ef5df35edd2cc606291f3f7985a61d41d5 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 7 Apr 2013 19:41:12 +0200 Subject: [PATCH] replace Server smart pointer with conventional one to gain control over dtor call order --- src/game.cpp | 22 +++++++++++++++++++--- src/main.cpp | 10 ---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 65feb50b..4f6eb472 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -992,6 +992,9 @@ void the_game( sound_is_dummy = true; } + Server *server = NULL; + + try{ // Event manager EventManager eventmgr; @@ -1007,9 +1010,8 @@ void the_game( /* Create server. - SharedPtr will delete it when it goes out of scope. */ - SharedPtr server; + if(address == ""){ draw_load_screen(L"Creating server...", driver, font); infostream<<"Creating server"<start(port); } - try{ do{ // Client scope (breakable do-while(0)) /* @@ -3290,10 +3291,25 @@ void the_game( L" running a different version of Minetest."; errorstream<