summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp6
-rw-r--r--Swiften/Server/ServerFromClientSession.h4
2 files changed, 4 insertions, 6 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index 6d4aba1..67067c5 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -31,7 +31,7 @@ ServerFromClientSession::ServerFromClientSession(
userRegistry_(userRegistry),
authenticated_(false),
initialized_(false) {
- xmppLayer_ = new XMPPLayer(payloadParserFactories_, payloadSerializers_);
+ xmppLayer_ = boost::shared_ptr<XMPPLayer>(new XMPPLayer(payloadParserFactories_, payloadSerializers_));
xmppLayer_->onStreamStart.connect(
boost::bind(&ServerFromClientSession::handleStreamStart, this, _2));
xmppLayer_->onElement.connect(
@@ -42,14 +42,12 @@ ServerFromClientSession::ServerFromClientSession(
boost::bind(boost::ref(onDataRead), _1));
xmppLayer_->onWriteData.connect(
boost::bind(boost::ref(onDataWritten), _1));
- connectionLayer_ = new ConnectionLayer(connection_);
+ connectionLayer_ = boost::shared_ptr<ConnectionLayer>(new ConnectionLayer(connection_));
streamStack_ = new StreamStack(xmppLayer_, connectionLayer_);
}
ServerFromClientSession::~ServerFromClientSession() {
delete streamStack_;
- delete connectionLayer_;
- delete xmppLayer_;
}
void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element) {
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index 9c37b3d..62e89ef 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -55,9 +55,9 @@ namespace Swift {
UserRegistry* userRegistry_;
bool authenticated_;
bool initialized_;
- ConnectionLayer* connectionLayer_;
+ boost::shared_ptr<XMPPLayer> xmppLayer_;
+ boost::shared_ptr<ConnectionLayer> connectionLayer_;
StreamStack* streamStack_;
- XMPPLayer* xmppLayer_;
JID domain_;
String user_;
JID jid_;