Core/IPC: Fixed a possible crash on shutdown

This commit is contained in:
Shauren
2014-11-08 02:48:11 +01:00
parent 929b657c7d
commit b646c53aa8
2 changed files with 12 additions and 1 deletions

View File

@@ -62,5 +62,13 @@ void Battlenet::ServerManager::SendChangeToonOnlineState(uint32 battlenetAccount
msg << toon;
msg << online;
_socket->Send(&msg);
Send(&msg);
}
void Battlenet::ServerManager::Send(zmqpp::message* msg)
{
if (!_socket)
return;
_socket->Send(msg);
}

View File

@@ -24,6 +24,7 @@
namespace zmqpp
{
class socket;
class message;
}
namespace Battlenet
@@ -45,6 +46,8 @@ namespace Battlenet
void SendChangeToonOnlineState(uint32 battlenetAccountId, uint32 gameAccountId, ObjectGuid guid, std::string const& name, bool online);
private:
void Send(zmqpp::message* msg);
static Header CreateHeader(BnetCommands command);
ZmqMux* _socket;
};