diff options
| author | oy <Tom_Adams@web.de> | 2011-07-30 13:50:22 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-07-30 13:50:22 +0200 |
| commit | b3e8506f20ac42902e575c4522502da94bace3ed (patch) | |
| tree | 3268a35655a1a8cd297c4008cf6dbf9b02cbc524 /src | |
| parent | a0a62bcd70d1d8c0874d5ff52e443b5fb417854c (diff) | |
| download | zcatch-b3e8506f20ac42902e575c4522502da94bace3ed.tar.gz zcatch-b3e8506f20ac42902e575c4522502da94bace3ed.zip | |
create client on heap. Closes #744
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/client/client.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 90131703..37fda6c2 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2342,7 +2342,7 @@ void CClient::RegisterCommands() m_pConsole->Chain("br_filter_serveraddress", ConchainServerBrowserUpdate, this); } -static CClient m_Client; +static CClient *CreateClient() { return new CClient(); } /* Server Time @@ -2373,9 +2373,10 @@ int main(int argc, const char **argv) // ignore_convention } #endif + CClient *pClient = CreateClient(); IKernel *pKernel = IKernel::Create(); - pKernel->RegisterInterface(&m_Client); - m_Client.RegisterInterfaces(); + pKernel->RegisterInterface(pClient); + pClient->RegisterInterfaces(); // create the components IEngine *pEngine = CreateEngine("Teeworlds"); @@ -2428,12 +2429,12 @@ int main(int argc, const char **argv) // ignore_convention pEngineMasterServer->Load(); // register all console commands - m_Client.RegisterCommands(); + pClient->RegisterCommands(); pKernel->RequestInterface<IGameClient>()->OnConsoleInit(); // init client's interfaces - m_Client.InitInterfaces(); + pClient->InitInterfaces(); // execute config file pConsole->ExecuteFile("settings.cfg"); @@ -2448,11 +2449,11 @@ int main(int argc, const char **argv) // ignore_convention // restore empty config strings to their defaults pConfig->RestoreStrings(); - m_Client.Engine()->InitLogfile(); + pClient->Engine()->InitLogfile(); // run the client dbg_msg("client", "starting..."); - m_Client.Run(); + pClient->Run(); // write down the config and quit pConfig->Save(); |