Use boost::shared_ptr instead of std::auto_ptr where threads are involved, because std::auto_ptr is not thread safe.

This commit is contained in:
lotodore
2007-11-14 13:19:28 +00:00
parent 9e7a6d7d8b
commit 5328bf082f
5 changed files with 12 additions and 14 deletions
+4 -5
View File
@@ -26,7 +26,6 @@
#include <playerdata.h>
#include <gamedata.h>
#include <string>
#include <memory>
#include <boost/shared_ptr.hpp>
class ClientContext;
@@ -151,14 +150,14 @@ private:
NetPacketList m_outPacketList;
mutable boost::mutex m_outPacketListMutex;
std::auto_ptr<ClientContext> m_context;
std::auto_ptr<ClientSenderCallback> m_senderCallback;
boost::shared_ptr<ClientContext> m_context;
boost::shared_ptr<ClientSenderCallback> m_senderCallback;
ClientState *m_curState;
GuiInterface &m_gui;
AvatarManager &m_avatarManager;
std::auto_ptr<SenderThread> m_sender;
std::auto_ptr<ReceiverHelper> m_receiver;
boost::shared_ptr<SenderThread> m_sender;
boost::shared_ptr<ReceiverHelper> m_receiver;
GameData m_gameData;
StartData m_startData;