diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 99e8c76a6..62fb62da8 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1908,21 +1908,8 @@ void CClient::Run() m_LastRenderTime = Now; - if(g_Config.m_DbgStress) - { - if((m_RenderFrames%10) == 0) - { - if(!m_EditorActive) - Render(); - else - { - m_pEditor->UpdateAndRender(); - DebugRender(); - } - m_pGraphics->Swap(); - } - } - else + // when we are stress testing only render every 10th frame + if(!g_Config.m_DbgStress || (m_RenderFrames%10) == 0 ) { if(!m_EditorActive) Render(); @@ -2234,12 +2221,7 @@ void CClient::RegisterCommands() m_pConsole->Chain("br_filter_serveraddress", ConchainServerBrowserUpdate, this); } -static CClient *CreateClient() -{ - CClient *pClient = static_cast(mem_alloc(sizeof(CClient), 1)); - mem_zero(pClient, sizeof(CClient)); - return new(pClient) CClient; -} +static CClient *CreateClient() { return new CClient();} /* Server Time @@ -2353,5 +2335,18 @@ int main(int argc, const char **argv) // ignore_convention // write down the config and quit pConfig->Save(); + // free components + delete pClient; + delete pKernel; + delete pEngine; + delete pConsole; + delete pStorage; + delete pConfig; + delete pEngineSound; + delete pEngineInput; + delete pEngineTextRender; + delete pEngineMap; + delete pEngineMasterServer; + return 0; } diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index c55590579..9358e4c3e 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1708,12 +1708,14 @@ int main(int argc, const char **argv) // ignore_convention // free delete pServer; delete pKernel; + delete pEngine; delete pEngineMap; delete pGameServer; delete pConsole; delete pEngineMasterServer; delete pStorage; delete pConfig; + return 0; }