summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-01 00:02:28 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-01 00:02:28 +0200
commitf6364253faccbe71de36375537c11324c62f420d (patch)
treecf2291f58d02028fc8b659502d8ea1a45e65cc0d /src/Common
parent85c914d0087458009ec74bbfdd4f7d8345aa1d2c (diff)
downloadmad-f6364253faccbe71de36375537c11324c62f420d.tar
mad-f6364253faccbe71de36375537c11324c62f420d.zip
Einige Memory Leaks gefixt
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Application.cpp8
-rw-r--r--src/Common/ClientConnection.cpp7
-rw-r--r--src/Common/ClientConnection.h1
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);