diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Common/Application.cpp | 8 | ||||
-rw-r--r-- | src/Common/ClientConnection.cpp | 7 | ||||
-rw-r--r-- | src/Common/ClientConnection.h | 1 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/Common/Application.cpp b/src/Common/Application.cpp index 196e57a..fdbcbeb 100644 --- a/src/Common/Application.cpp +++ b/src/Common/Application.cpp @@ -24,11 +24,15 @@ #include "SystemManager.h" #include "UserManager.h" +#include <libxml/parser.h> + namespace Mad { namespace Common { Application::Application(bool server) : authManager(new AuthManager), moduleManager(new ModuleManager(this)), requestManager(new RequestManager(this, server)), -systemManager(new SystemManager), userManager(new UserManager(this)) {} +systemManager(new SystemManager), userManager(new UserManager(this)) { + xmlInitParser(); +} Application::~Application() { delete userManager; @@ -36,6 +40,8 @@ Application::~Application() { delete requestManager; delete moduleManager; delete authManager; + + xmlCleanupParser(); } } diff --git a/src/Common/ClientConnection.cpp b/src/Common/ClientConnection.cpp index 4182806..02abcd1 100644 --- a/src/Common/ClientConnection.cpp +++ b/src/Common/ClientConnection.cpp @@ -28,7 +28,12 @@ ClientConnection::ClientConnection(Core::Application *application) : Connection( connection->connectSignalReceive(boost::bind(&ClientConnection::receive, this, _1)); } -bool ClientConnection::send(const Net::Packet &packet) { +ClientConnection::~ClientConnection() { + connection->disconnect(); + connection->waitWhileConnected(); +} + +bool ClientConnection::send(const Net::Packet &packet) { return connection->send(packet); } diff --git a/src/Common/ClientConnection.h b/src/Common/ClientConnection.h index 7bdceba..302c938 100644 --- a/src/Common/ClientConnection.h +++ b/src/Common/ClientConnection.h @@ -44,6 +44,7 @@ class MAD_COMMON_EXPORT ClientConnection : public Connection { public: ClientConnection(Core::Application *application); + virtual ~ClientConnection(); void connect(const boost::asio::ip::tcp::endpoint &address) throw(Core::Exception); |