diff options
Diffstat (limited to 'Swiften/Network')
-rw-r--r-- | Swiften/Network/BoostConnectionFactory.cpp | 5 | ||||
-rw-r--r-- | Swiften/Network/BoostConnectionFactory.h | 7 | ||||
-rw-r--r-- | Swiften/Network/ConnectionFactory.h | 9 |
3 files changed, 9 insertions, 12 deletions
diff --git a/Swiften/Network/BoostConnectionFactory.cpp b/Swiften/Network/BoostConnectionFactory.cpp index a1bef15..3f62730 100644 --- a/Swiften/Network/BoostConnectionFactory.cpp +++ b/Swiften/Network/BoostConnectionFactory.cpp @@ -1,12 +1,13 @@ #include "Swiften/Network/BoostConnectionFactory.h" +#include "Swiften/Network/BoostConnection.h" namespace Swift { BoostConnectionFactory::BoostConnectionFactory(boost::asio::io_service* ioService) : ioService(ioService) { } -BoostConnection* BoostConnectionFactory::createConnection() { - return new BoostConnection(ioService); +boost::shared_ptr<Connection> BoostConnectionFactory::createConnection() { + return boost::shared_ptr<Connection>(new BoostConnection(ioService)); } } diff --git a/Swiften/Network/BoostConnectionFactory.h b/Swiften/Network/BoostConnectionFactory.h index d15770d..5695c6c 100644 --- a/Swiften/Network/BoostConnectionFactory.h +++ b/Swiften/Network/BoostConnectionFactory.h @@ -1,5 +1,4 @@ -#ifndef SWIFTEN_BoostConnectionFactory_H -#define SWIFTEN_BoostConnectionFactory_H +#pragma once #include <boost/asio.hpp> @@ -13,11 +12,9 @@ namespace Swift { public: BoostConnectionFactory(boost::asio::io_service*); - virtual BoostConnection* createConnection(); + virtual boost::shared_ptr<Connection> createConnection(); private: boost::asio::io_service* ioService; }; } - -#endif diff --git a/Swiften/Network/ConnectionFactory.h b/Swiften/Network/ConnectionFactory.h index ef4eec9..e78f6ab 100644 --- a/Swiften/Network/ConnectionFactory.h +++ b/Swiften/Network/ConnectionFactory.h @@ -1,5 +1,6 @@ -#ifndef SWIFTEN_ConnectionFactory_H -#define SWIFTEN_ConnectionFactory_H +#pragma once + +#include <boost/shared_ptr.hpp> namespace Swift { class Connection; @@ -8,8 +9,6 @@ namespace Swift { public: virtual ~ConnectionFactory(); - virtual Connection* createConnection() = 0; + virtual boost::shared_ptr<Connection> createConnection() = 0; }; } - -#endif |