Răsfoiți Sursa

auto_ptr -> shared_ptr see http://gcc.gnu.org/onlinedocs/libstdc++/manual/auto_ptr.html

ori.bar 14 ani în urmă
părinte
comite
ebacb433fe
2 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 2 2
      client/Client.cpp
  2. 1 1
      client/Client.h

+ 2 - 2
client/Client.cpp

@@ -376,7 +376,7 @@ void CClient::newGame( CConnection *con, StartInfo *si )
 			battleints[color] = playerint[color];
 
 			playerint[color]->init(cb);
-			callbacks[color] = std::auto_ptr<CCallback>(cb);
+			callbacks[color] = boost::shared_ptr<CCallback>(cb);
 		}
 		else
 		{
@@ -463,7 +463,7 @@ void CClient::serialize( Handler &h, const int version )
 			else
 				nInt = new CPlayerInterface(pid);
 
-			callbacks[pid] = std::auto_ptr<CCallback>(new CCallback(gs,pid,this));
+			callbacks[pid] = boost::shared_ptr<CCallback>(new CCallback(gs,pid,this));
 			battleints[pid] = playerint[pid] = nInt;
 			nInt->init(callbacks[pid].get());
 			nInt->serialize(h, version);

+ 1 - 1
client/Client.h

@@ -64,7 +64,7 @@ class CClient : public IGameCallback
 {
 public:
 	CCallback *cb;
-	std::map<ui8,std::auto_ptr<CCallback> > callbacks; //callbacks given to player interfaces
+	std::map<ui8,boost::shared_ptr<CCallback> > callbacks; //callbacks given to player interfaces
 	std::vector<IGameEventsReceiver*> privilagedGameEventReceivers; //scripting modules, spectator interfaces
 	std::vector<IBattleEventsReceiver*> privilagedBattleEventReceivers; //scripting modules, spectator interfaces
 	std::map<ui8,CGameInterface *> playerint;