forked from 0ad/0ad
Call enet_initialize (see previous commit message). Fixes #509.
This was SVN commit r7681.
This commit is contained in:
parent
3ff0ccc1fa
commit
56b836f58d
@ -67,3 +67,14 @@ ENetPacket* CNetHost::CreatePacket(const CNetMessage* message)
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
void CNetHost::Initialize()
|
||||
{
|
||||
int ret = enet_initialize();
|
||||
debug_assert(ret == 0);
|
||||
}
|
||||
|
||||
void CNetHost::Deinitialize()
|
||||
{
|
||||
enet_deinitialize();
|
||||
}
|
@ -57,6 +57,17 @@ public:
|
||||
* @return NULL on failure
|
||||
*/
|
||||
static ENetPacket* CreatePacket(const CNetMessage* message);
|
||||
|
||||
/**
|
||||
* Initialize ENet.
|
||||
* This must be called before any other networking code.
|
||||
*/
|
||||
static void Initialize();
|
||||
|
||||
/**
|
||||
* Deinitialize ENet.
|
||||
*/
|
||||
static void Deinitialize();
|
||||
};
|
||||
|
||||
#endif // NETHOST_H
|
||||
|
@ -618,6 +618,8 @@ void Shutdown(int UNUSED(flags))
|
||||
TIMER_BEGIN(L"shutdown misc");
|
||||
timer_DisplayClientTotals();
|
||||
|
||||
CNetHost::Deinitialize();
|
||||
|
||||
// should be last, since the above use them
|
||||
SAFE_DELETE(g_Logger);
|
||||
delete &g_Profiler;
|
||||
@ -700,6 +702,8 @@ void Init(const CmdLineArgs& args, int flags)
|
||||
// and fonts are set later in InitPs())
|
||||
g_Console = new CConsole();
|
||||
|
||||
CNetHost::Initialize();
|
||||
|
||||
if(setup_vmode)
|
||||
InitSDL();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user